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 make and use web service in Microsoft Dynamics Navision.

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