manual coding of login and logout in asp.net with c#, after that every click shows the login page...without the user login them........!

Recommended Answers

All 3 Replies

Check out using session variables for recording the logged in status of a user. Each page can check the session state to see if the user is logged in or not and either redirects them to the login page or lets them view the page they are on.
As for logging in, take the user's id and password, check that against what is stored in the database and set the session variable to show logged in status if the details match.
When the user logs out simply clear the session state.
You can examples of all of this on the net or in a book

manual coding of login and logout in asp.net with c#, after that every click shows the login page...without the user login them........!

To code your login page manually,
>First you need to create your own controls on the login page
>code the login button to validate already registered users in your database
>it would be best you use session tracking so as to grant authenticated users access to the main page and also, when the uses logs out, it ends the current session and goes back to the defined login page

You can find the attachment useful on session tracking


as for the part of displaying the login page all the time, please make yourself clear.

You can use login control of asp.net [visual studio 2005,2008,2010]. where you will find each control. example login, logout, redirect, log in status, Password recovery, change password etc. Just drag and drop that control in your page . and use them. If you don't know how to use them in your application. Just search "login control for asp.net" on Google.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.