Hi
Friends
i have one application in that application i login using username and password then i access all pages in my aplication then after i logout.
this is main thing
i logout then after i type url like http://localhost:2424/sample/select.aspx
it ll be display.
i need to display login page in that time(any page i type above url i want to display login page).
and also after i logout i dont want to work back and forward button.
if i logout then after i click back or forward button i need to display login page.
Loading


Ankit NandekarRank #703 · 3.4K reputationPosted May 3, 2011, 10:28 PM EDT
and then check session is null or not on every page load event like
if (Session["Sessionname"] == null)
{
Response.Redirect("Login.aspx");
}
or u can use Form authentication to do this when user dont have credential it is automaticaly redirect user to login page.
Amit ChoudharyRank #145 · 15.8K reputationPosted May 3, 2011, 10:34 PM EDT
If you are using RoleManager/Membership provider then here's the code that will help you. you have to set the authorization settings in your web.config.