Logout code for Asp.Net

For logout in your web site you have to clear all the session ,so write following code in "Logout" button click event:

protected void btnSend_Click(object sender, EventArgs e)
{
        Session.Abandon();
        Session.Contents.RemoveAll();
        System.Web.Security.FormsAuthentication.SignOut();
        Response.Redirect("LoginPage.aspx");
 }

See Also :


  Follow Me On Facebok

--
/\/ir@\/  <(.'.)>

Comments

Popular posts from this blog

How to get column value from the selected row in data grid in wpf c#.net

How to make and use web service in Microsoft Dynamics Navision.

How to use Format function in Microsoft Dynamics Navision.