Session.RemoveAll();
Session.Abandon();
Response.ClearHeaders();
if (Session["name"] == null)
{
Response.Redirect("login.aspx");
}
I have used this line for logout code , after getting logout i i tried pasting the URL in another tab it is showing
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 31: {
Line 32: con.Open();
Line 33: Label1.Text = Session["name"].ToString();
Line 34: string a = ("select name from user2 where name='" + Label1.Text + "'");
i dont want to show this error message, i want to reload the login page when Pasting URL or Back Button ..how can i do this?