내 요구 사항은 입니다. 1) 역할을 만들고 특정 역할에 사용자를 추가하십시오. 2) 관리자 만 액세스 할 수있는 aspx 페이지가 포함 된 디렉토리가 있습니다. 3) aspx 페이지를 폴더에 액세스하려고 시도하면 로그인 페이지로 리디렉션하고 싶습니다. Asp.net 회원에 관한 질문
내가 가진이는 로그인 양식을 에 대한 사용자 및 역할과 다양한 기능을 만드는 Asp.net 회원을 사용하여 구현합니다. 질문은 새 사용자를 만들고 해당 사용자를 특정 역할에 할당하기 위해 asp.net 구성을 열어야 할 때마다 발생합니다. 라이브 사이트에 내 웹 사이트를 배포하는 경우 그래서 어떻게 지금 사용자를 추가 할 수 있습니다.
은 내가 어떤 도움을 내 requirement.Thanks을 충당하기 위해 따라야 할 어떤 다른 방법 다음 Asp.net 회원으로 가능하지 않은 경우 내가 내 웹 설정 파일
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=true;Initial Catalog=Web24;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms loginUrl="~/WebForm1.aspx" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear/>
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
</providers>
</roleManager>
</system.web>
<location path="Admin">
<system.web>
<authorization>
<deny users="?" />
<!--Deny all Anonymous (not logged in) users-->
<allow roles="Admin"/>
<!--Permit users in these roles-->
<deny users="*"/>
<!--Deny all users-->
</authorization>
</system.web>
</location>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
을 나열하고있다.
그 뭔가를 추가 할 수 있습니다 곳에서 관리자를위한 페이지를 만들 수 있습니다 - 당신은 그냥 필요 사용자를 만들기위한 관리 영역에 UI를 작성하려면 유틸리티를 사용하는 대신 코드로 멤버쉽 공급자를 사용해야합니다. –