hii
how can i implement logout feature on my page so that user is redirected to a new page and is not allowed to view previous page.
hii
how can i implement logout feature on my page so that user is redirected to a new page and is not allowed to view previous page.
if (SessionConfig.Current.UserType != null)
Response.Redirect("~/Logout.aspx?UserType=" + SessionConfig.Current.UserType,false);
else
Response.Redirect("~/Default.aspx",false);
where sessionconfig is a session variable already declared.
public static SessionConfig Current
{
get
{
SessionConfig session =
(SessionConfig)HttpContext.Current.Session["__SessionConfig__"];
if (session == null)
{
session = new SessionConfig();
HttpContext.Current.Session["__SessionConfig__"] = session;
}
return session;
}
}
Just put this in button click event and change to your home page in homepage.aspx . It will redirect the page and you cannot see the old page
take a look at ASP.net Login Controls
if you want the user to not be allowed to back to the previous page see this topic
First of all, enable asp.net security permissions and set anonymous users access as Denied. then, use asp.net log-in control and set it up as you wish...