The Web. config is configured to make it easy to connect to the database using Microsoft-provided membership classes, such as
<?XML version= "1.0" encoding= "Utf-8"?><!--For more information about how to configure an ASP. NET application, go to http://go.microsoft.com/fwlink/?LinkId=169433 -<Configuration> <connectionStrings> <!--Data Connection - <Addname= "Conn"connectionString= "server=."; Database=vsdb;uid=sa;pwd=admin "ProviderName= "System.Data.SqlClient"/> <!--Complex connection Mode connectionstring= "Data source=.; attachdbfilename=| Datadirectory|\aspnet.mdf;initial catalog=aspnet;integrated security=true; User instance=true; Multipleactiveresultsets=true " - </connectionStrings> <system. Web> <compilationDebug= "false"targetframework= "4.0" /> < Profiledefaultprovider= "Defaultprofileprovider" > <providers> <Addname= "Defaultprofileprovider"type= "System.Web.Providers.DefaultProfileProvider"connectionStringName= "DefaultConnection"ApplicationName="/"/> </providers> </ Profile> <!--member Management - <Membershipdefaultprovider= "AspNetSqlMembershipProvider"> <providers> <Clear/> <Addname= "AspNetSqlMembershipProvider"type= "System.Web.Security.SqlMembershipProvider, system.web, version=2.0.3600.0, Culture=neutral, publickeytoken= B03F5F7F11D50A3A "connectionStringName= "Conn"enablePasswordRetrieval= "false"enablePasswordReset= "true"requiresQuestionAndAnswer= "false"requiresUniqueEmail= "false"maxinvalidpasswordattempts= "3"minRequiredPasswordLength= "6"minRequiredNonalphanumericCharacters= "0"passwordAttemptWindow= "Ten"ApplicationName="/" /> <!--connectionStringName: The name of the connection string - <!--enablePasswordReset: Gets a value that indicates whether the password can be reset. - <!--enablepasswordretrieval: Gets a value that indicates whether the user is allowed to extract the password. - <!--Hashalgorithmtype: Gets a value for the algorithm identifier of the password - <!--maxinvalidpasswordattempts: Gets a value that locks the number of retries allowed between users. - <!--minrequirednonalphanumericcharacters: Gets a value that has the fewest number of special characters in the password. Password Strength - <!--minrequiredpasswordlength: Get the Minimum password length - <!--requiresquestionandanswer: Gets a value that indicates whether the user is asked to answer the password question to re-extract the password. - <!--Userisonlinetimewindow: Specifies the number of minutes after the user's last activity date, in which the user is considered online. - <!--requiresUniqueEmail: Whether the mailbox name is unique - <!--...... - </providers> </Membership> <!--Role Management - <rolemanagerenabled= "true"cacheRolesInCookie= "true"> <providers> <Clear/> <AddconnectionStringName= "Conn"ApplicationName="/"name= "AspNetSqlRoleProvider"type= "System.Web.Security.SqlRoleProvider, system.web, version=2.0.0.0, Culture=neutral, publickeytoken= B03F5F7F11D50A3A "/> </providers> </rolemanager> <sessionstateMode= "Custom"CustomProvider= "Defaultsessionprovider"> <providers> <Addname= "Defaultsessionprovider"type= "System.Web.Providers.DefaultSessionStateProvider"connectionStringName= "DefaultConnection"ApplicationName="/"/> </providers> </sessionstate> </system.web></Configuration>
ASP. NET membership and role management configuration content