-1

As mentioned in this link

I have hashed the password and stored LogIn details in my Database table.

Now I'm using LogIn page of already existing ASP.NET page (through Account folder that is in-built).. How do I make this page to interact with my DB and redirect to his/her profile?

4

1 回答 1

1

If you are using asp.net membership provider

After you obtain the username and password you can call Membership.ValidateUser method.

eg

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");
}

Read more about Use Membership in ASP.NET

于 2012-08-16T10:58:14.013 回答