protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { MembershipProvider ProviderName = Membership.Providers["MySqlMembershipProvider2"]; if (Membership.ValidateUser(Login1.UserName, Login1.Password) == true) { e.Authenticated = true; Login1.DestinationPageUrl = "~/Start.aspx"; } else { if (Membership.Providers["MySqlMembershipProvider2"].ValidateUser(Login1.UserName, Login1.Password) == true) { RoleProvider RoleName= Roles.Providers["MySqlRoleProvider2"]; ProviderName.GetUser(Login1.UserName,true); e.Authenticated = true; Login1.DestinationPageUrl = "~/CL/CLLogin.aspx"; } else { e.Authenticated = false; } } }
<roleManager defaultProvider="MySQLRoleProvider" enabled="true"> <providers> <clear/> <add name="MySQLRoleProvider" connectionStringName="MySQLMembershipConnection" applicationName="/" type="MySql.Web.Security.MySQLRoleProvider" autogenerateschema="true"/> <add name="MySQLRoleProvider2" connectionStringName="MySQLMembershipConnection2" applicationName="/" type="MySql.Web.Security.MySQLRoleProvider" autogenerateschema="true"/> </providers> </roleManager> <anonymousIdentification enabled="true"/> <membership defaultProvider="MySQLMembershipProvider"> <providers> <clear/> <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider" connectionStringName="MySQLMembershipConnection" autogenerateschema="true" applicationName="/" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"/> <add name="MySQLMembershipProvider2" type="MySql.Web.Security.MySQLMembershipProvider" connectionStringName="MySQLMembershipConnection2" autogenerateschema="true" applicationName="/" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"/> </providers> </membership> <profile defaultProvider="MySQLProfileProvider"> <providers> <clear/> <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySqlProfileProvider" applicationName="/" connectionStringName="MySQLMembershipConnection" autogenerateschema="true"/> <add name="MySQLProfileProvider2" type="MySql.Web.Profile.MySqlProfileProvider" applicationName="/" connectionStringName="MySQLMembershipConnection2" autogenerateschema="true"/> </providers> <properties> <add name="FullName" provider="MySQLProfileProvider"/> <add name="FName" provider="MySQLProfileProvider"/> <add name="ClassName" provider="MySQLProfileProvider2"/> <add name="Area" provider="MySQLProfileProvider2"/> </properties> </profile> <sessionState> <providers> <add name="MySqlSessionStateStore" type="MySql.Web.SessionState.MySqlSessionStateStore,MySql.Web"/> <add name="MySqlSessionStateStore2" type="MySql.Web.SessionState.MySqlSessionStateStore,MySql.Web"/> </providers> </sessionState>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)