Having just set up .net membership, profiles etc using the standard .net 2.0 login controls, I thought I would highlight some of the problems here that I came across when implementing a pretty standard solution.
Issues with implementing the standard .net user controls with standard membership providers
Web.Config configuration issues
Make sure that the defaultProvider property of membership tag is set to be the same as the name attribute on the provider that you are intending to use.
<membership defaultProvider="memProvider">
<providers>
<add applicationName="profileTest" connectionStringName="dbConnect" name="memProvider" type="System.Web.Security.SqlMembershipProvider" passwordFormat="Clear" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="3"/>
</providers>
</membership>
Make sure that the applicationName is the same as the one that is defined in the SQLServer database table ‘aspnet_Applications’ on the database that you have created to hold the membership data in. (default database aspnetdb). Check the column ‘ApplicationName’
<membership defaultProvider="memProvider">
<providers>
<add applicationName="profileTest" connectionStringName="dbConnect" name="memProvider" type="System.Web.Security.SqlMembershipProvider" passwordFormat="Clear" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="3"/>
</providers>
</membership
To change the password strength
To change the default password strength you must first override the machine.config value for the attributes ‘minRequiredNonalphanumericCharacters’ and ‘minRequiredPasswordLength’. Either change these in the machine.config or remove the key and then add the provider again to override in the web.config.
<remove name="AspNetSqlMembershipProvider" />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
Source: http://hostlibrary.com/ChangingthePasswordComplexityinASP.NETV2.0.html
Can’t Log in problem
If the login control will not log in even though you have definitely entered the correct log in details and you have checked that the applicationName is correct (see above) then make sure that you have not over ridden the event handler for the login control.
If you double click the control and have the event handler: Login1_Authenticate is not present.
If it is, then either delete it as this will stop the provider from working, or implement your own authenticate code into the event handler user if(Membership.ValidateUser(username,password)) to check if the user is successful.
Resources:
Standard .net control controlAdaptor classes which contain control adaptors to make the login controls accessible. (to a degree).
http://www.asp.net/CSSAdapters/Default.aspx