bool IsPageRefresh = false; //this section of code checks if the page postback is due to genuine submit by user or by pressing "refresh" if (!IsPostBack) { ViewState["ViewStateId"] = System.Guid.NewGuid().ToString(); Session["SessionId"] = ViewState["ViewStateId"].ToString(); } else { if (ViewState["ViewStateId"].ToString() != Session["SessionId"].ToString()) { IsPageRefresh = true; } Session["SessionId"] = System.Guid.NewGuid().ToString(); ViewState["ViewStateId"] = Session["SessionId"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)