Total Pageviews

Tuesday, 29 November 2011

Step by step of ASP.NET membership


Step by step of ASP.NET membership
1.       Run aspnet_regsql.exe which located in C:\Windows\Microsoft.NET\Framework64\v4.0.30319.  This wizard gets connection info and creates some database tables, views, SPs with prefix ‘aspnet_’.
2.       Set in your web.config the following lines
   <connectionStrings>
    <add name="USRDBConnectionString" connectionString="Data Source=172.168.10.40;Initial Catalog=TvLibrary;User ID=sa;Password=sa1234;Max Pool Size=75;Min Pool Size=5;" providerName="System.Data.SqlClient"/>
  </connectionStrings>

<membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="USRDBConnectionString" 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="USRDBConnectionString" applicationName="/"/>
      </providers>
</profile>

<roleManager>
      <providers>
        <clear />
        <add connectionStringName="USRDBConnectionString" applicationName="/"
          name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
          type="System.Web.Security.WindowsTokenRoleProvider" />
      </providers>
</roleManager>

3.       Then go menu Website->ASP.NET configuration


No comments:

Post a Comment