One size can't fit all, that we're both know.
Last weekend, a custom want their Login have professional look and user-friendly with more tips on the screen come with nice images and a CATPCHA. My god, their layout design is far from the way we can do with Login control, event with CSS or CCS Control Adapters. Then i decided to create LogIn form myself based on their layout instead of using the ASP.NET built-in LogIn control. Here is how i do, help this will help someone else
protected void Authenticate()
{
if (Membership.ValidateUser(txtUserName.Text, txtPassword.Text))
{
lblMessage.Visible = false;
if (Request.QueryString["ReturnUrl"] != null)
{
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false);
}
else
{
if (HttpContext.Current.Items.Contains("ConcordeFormTicket"))
{
Concorde.Web.DataAccess.ConcordeFormTicket authenticationTicket =
HttpContext.Current.Items["ConcordeFormTicket"] as Concorde.Web.DataAccess.ConcordeFormTicket;
FormsAuthentication.SetAuthCookie(authenticationTicket.UserName, true);
HttpContext.Current.Session["ConcordeFormTicket"] = authenticationTicket;
}
Response.Redirect(Request.QueryString["ReturnUrl"]);
}
}
else
{
lblMessage.Text = "Login failed. Please check your user name and password and try again.";
lblMessage.Visible = true;
}
}
protected void cmdLogin_Click(object sender, EventArgs e)
{
if(IsValid)
Authenticate();
}