[Solved] How to prevent Session variables getting lost when idle in ASP.Net

Last Reply on May 05, 2015 02:17 AM By Mudassar

Posted on May 05, 2015 01:49 AM

hello,

i'm using session variables for send variables between aspx page and it works fine ...but after some time of inctivity(user) in the page the sessions is los...how can i resolve this issue ? this is my code below how to send session :

 protected void Lst_Interv(object sender, EventArgs e)
        {
            Session["Id"] = gdMedical.SelectedRow.Cells[0].Text.Trim();
            Session["Service"] = gdMedical.SelectedRow.Cells[6].Text.Trim();
            Session["Nom"] = gdMedical.SelectedRow.Cells[2].Text.Trim();
            string pageurl = "LstIntervention.aspx";
            Response.Write("<script> window.open('" + pageurl + "','_blank'); </script>");
        }

 

Posted on May 05, 2015 02:17 AM

If user is active Session will be lost. If you want you increase Session Timeout to some higher value

Refer:

  1. What is the Default Session TimeOut in ASP.Net and from where I can change it