Tuesday, 05 March 2013 13:55

how to use membership provider for asp.net login

Written by 
Rate this item
(0 votes)

using asp.net membership Probvider you can easily
make a user login using username and password and redirect to
default or any page by the following way -

//UserName and Password textboxes takes user name and pass inputs

if (Membership.ValidateUser(UserName.Text.Trim() , Password.Text.Trim()))
{

FormsAuthentication.RedirectFromLoginPage(UserName.Text.Trim(), false);
Response.Redirect("~/Projects.aspx");
}

}
else
{
Response.Write("Input correct User Name and Password!");
}

the above codes first validate a user with user name and password then

redirects the user to Projects.aspx page by logging in the user.

Read 2988 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.