Add the following code in your Page_Load event, and it will be all fine.
if (!IsPostBack)
{
ViewState["postids"] = System.Guid.NewGuid().ToString();
Session["postid"] = ViewState["postids"].ToString();
}
else
{
if (ViewState["postids"].ToString() != Session["postid"].ToString())
{
IsPageRefresh = true;
}
Session["postid"] = System.Guid.NewGuid().ToString();
ViewState["postids"] = Session["postid"].ToString();
}
Try and understand the code. Let me know if you don't get it.
PS: I took this solution from somewhere on the web (I don't remember the link now) and used it in one of my projects.
Cheers!
Ankur