I have written the code for preventing user Authentication in my GET Method like below
if (!string.IsNullOrEmpty(Session["UserName"].ToString()))
{
MyConnection mycon = new MyConnection();
string str = "";
int res = 0;
if (Request.QueryString.ToString().Contains("ID1"))
{
str = "Delete from PostTable where PostID=" + Request.QueryString["ID1"];
res = mycon.IODPost(str);
}
return View(AllPostList());
}
else
{
return RedirectToAction("Home", "Home");
}
but when i press Back button in browser after signout, the page is postback to the previous page which can't be done.. so what should i do to prevent this?