Q:

how to implement logout functionality in asp.net c#

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.  

A:

  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

