I had a problem with my internet explorer where when i refresh page the submit button the a page would also execute which was leading to double entry of data . for that i had to right the code for the refresh page where it wud clear the cache and session or it wud not enter last session values .
from the time i implemented this code it gives me
Object reference not set to an instance
Here is the code:
protected void Page_Load(object sender, EventArgs e)
{
try
{
Session["DdlValue"] = DdlfacilityInsfindCsu.SelectedValue;
if (!IsPostBack)
{
Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
GetDdl();
GetDdlIn();
}
}
catch (Exception ex)
{
lblmess.Text = ex.Message.ToString();
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
ViewState["CheckRefresh"] = Session["CheckRefresh"]; ---- This is for avoiding double entry on page refresh page .
}
protected void btnsubmitinsuranceentryCsu_Click(object sender, EventArgs e)
{
//if (Page.IsValid)
//{
try
{
if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
{
InsertDataI();
Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
}
}
catch (Exception ex)
{
lblmesss.Text = ex.Message.ToString();
}
//}
}
can anyone help me on this?
Thanks.
Here is an example how to set/increase session timeout:
By default it’s 20 minutes.
Here is an article on MSDN: http://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx