On .aspx page write take a hidden field:
<asp:HiddenField id="hdncheckreload" runat="server" />
On .cs page write a function to check whether it's first time call event or reloaded......
public bool notIsRefresh()
{
bool retVal = false;
if (Session["match"] == null || Session["match"].ToString() == hdncheckreload.Value)
retVal = true;
Session["match"] = DateTime.Now.Ticks;
hdncheckreload.Value = Session["match"].ToString();
return retVal;
}
call this method on event which is reloaded such as button click event, form submission etc...
<asp:HiddenField id="hdncheckreload" runat="server" />
On .cs page write a function to check whether it's first time call event or reloaded......
public bool notIsRefresh()
{
bool retVal = false;
if (Session["match"] == null || Session["match"].ToString() == hdncheckreload.Value)
retVal = true;
Session["match"] = DateTime.Now.Ticks;
hdncheckreload.Value = Session["match"].ToString();
return retVal;
}
call this method on event which is reloaded such as button click event, form submission etc...
No comments:
Post a Comment