0

To ad log in credentials to a page, accessed by a database. Would you just check a user table in the database that stores lets say, UID, UserName, UserPW and see if there credentials exist? If so, how would you do that?

Also, how would you keep track if they are logged in on each page?

Basically, this is the part of my assignment I am trying to do.

"In order to add, edit, delete cars, the user must log in using credentials that are stored in the database. You must also keep track of whether the person is logged in on every page."

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by dnanetwork
0

Hi V;
You can use membership and data control for that.Or else after validating the user existence u can retrive that username or userId from database to frontend and then store it inside a session .Then Pass the session to every page where u want.

0
if(txtuserName.Text == "Jigsaw" && txtPassword == "aa")
{
  FormsAuthentication.RedirectFromLoginPage(txtuserName.Text,false);
}

// if correct credentitals then you go to default.aspx page or default page
//you have provided in your web.config file

//once you reach the default.aspx page, go to code behind in Page_Load Event

// Try this

if(Request.IsAuthenticated)
{
   Response.Write(User.Identity.Name);
}
else
{
  // Redirect to Login Page
}

// in web.config keep Authentication Mode = Forms
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.