I usually use the Forms Authentication for a login form as
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if(FormsAuthentication.Authenticate(Login1.UserName, Login1.Password))
{
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
}
}
and the web.config
has
<authentication mode="Forms">
<forms defaultUrl="Page.aspx">
<credentials passwordFormat="Clear">
<user name="Enter here" password="Enter here" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
However, this does not work for .NET 4.5. What is a better way?