Block going back to the previous page after LOGOUT

 

Normally we write the code in logout.aspx page.Here in this case the assumption is when we click on the logout button the control should go to login.aspx.

The solution is just a javascript.... Try out and enjoy the way you work !!!!!

if you want to apply it in ASP.Net write

StringBuilder sb = new StringBuilder();
sb.Append("<script language='Javascript'>");
sb.Append("top.location='login.aspx';"); //
sb.Append("</script>");
Page.RegisterClientScriptBlock("disable", sb.ToString());

OR

Response.write("<script language='Javascript'>top.location='login.aspx';</script>");