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 use serial.write() in Arduino.

How to Generate random rows in dataset using c#.net

How to use Format function in Microsoft Dynamics Navision.