HandleFormsLogin

Vote:
 
Hello! Im working on a site with EPiServer CMS 5 and i'm trying to implement a custom login control. Is there a way to handle login similar to previous EPiServer versions like the code below? url = EPiServer.Util.LoginBase.HandleFormsLogin(txtLogin.Text, txtPassword.Text, CheckBoxPersistCookie.Checked); if (url != null) { Response.Redirect(url); } else { Response.Redirect(CurrentPage.LinkURL); }
#15700
Mar 25, 2008 19:07
Vote:
 
You have to use the static method Membership.ValidateUser to validate using your MembershipRoleProvider. Here's how it's one on MSDN (http://msdn2.microsoft.com/en-us/library/ms998347.aspx): if (Membership.ValidateUser(userName.Text, password.Text)) { if (Request.QueryString["ReturnUrl"] != null) { FormsAuthentication.RedirectFromLoginPage(userName.Text, false); } else { FormsAuthentication.SetAuthCookie(userName.Text, false); } } else { Response.Write("Invalid UserID and Password"); }
#16177
Mar 25, 2008 19:08
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.