code_junkie

Problem with Login control of ASP.NET

Nov 10th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <asp:Login ID="Login1" runat="server"
  2. MembershipProvider="MySqlMembershipProvider">
  3. <LayoutTemplate>
  4. <!-- template code snipped for brevity -->
  5. </LayoutTemplate>
  6. </asp:Login>
  7.  
  8. <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
  9. MembershipProvider="MySqlMembershipProvider">
  10. <WizardSteps>
  11. <asp:CreateUserWizardStep runat="server" />
  12. <asp:CompleteWizardStep runat="server" />
  13. </WizardSteps>
  14. </asp:CreateUserWizard>
  15.  
  16. protected void LoginCtl_Authenticate(object sender, AuthenticateEventArgs e)
  17. {
  18. // Check the Credentials against DB
  19. bool authed = DAL.Authenticate(user, pass);
  20. e.Authenticated = authed;
  21. }
  22.  
  23. <!--Deny all users -->
  24. <authorization>
  25. <deny users="*" />
  26. </authorization>
  27.  
  28. <!--Deny all users unless autherticated -->
  29. <authorization>
  30. <deny users="?" />
  31. </authorization>
  32.  
  33. <configuration>
  34. <system.web>
  35. <authorization>
  36. <allow roles="Admins"/>
  37. <deny users="*"/>
  38. </authorization>
  39. </system.web>
  40. </configuration>
  41.  
  42. <authentication mode="Forms">
  43. <forms name="SqlAuthCookie" timeout="10" loginUrl="Login.aspx"/>
  44. </authentication>
  45. <authorization>
  46. <deny users="?"/>
  47. <allow users="*"/>
  48. </authorization>
  49. <membership defaultProvider="MySqlMembershipProvider">
  50. <providers>
  51. <clear/>
  52. <add name="MySqlMembershipProvider" connectionStringName="MyLocalSQLServer" applicationName="MyAppName" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  53. </providers>
  54. </membership>
  55.  
  56. <connectionStrings>
  57. <add name="MyLocalSQLServer" connectionString="Initial Catalog=aspnetdb;data source=iballanbsqlexpress;uid=full;pwd=full;"/>
  58. </connectionStrings>
Add Comment
Please, Sign In to add comment