Page_load not fired after some time of inactivity

  • Thread starter Michal Kostic via .NET 247
  • Start date
M

Michal Kostic via .NET 247

Hi

I am encountering following ASP.NET problem:
In the Page_Load event I initialize connection string of a sqlconnection. This works fine most of the time, but when the usercontinues using the page after long time of inactivity (he/shekept the IE window open for e.g. 20 minutes and then pressessome button), the Page_Load event is not fired and as result theconnection is not initialized with proper string.
This happens also for other variables that are initialized in thePage_Load event.
I have tried also adding the no-cache code
{
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
}
but does not help.
Any suggestions?

Thanks in advance
Michal Kostic
 
H

Hans Kesting

Michal said:
Hi

I am encountering following ASP.NET problem:
In the Page_Load event I initialize connection string of a sql
connection. This works fine most of the time, but when the user
continues using the page after long time of inactivity (he/she kept
the IE window open for e.g. 20 minutes and then presses some button),
the Page_Load event is not fired and as result the connection is not
initialized with proper string.
This happens also for other variables that are initialized in the
Page_Load event.
I have tried also adding the no-cache code
{
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
}
but does not help.
Any suggestions?

Thanks in advance
Michal Kostic

20 minutes is the default Session-expiry time. Are you sure it's the Page_Load
and not the Session where values disappear? How do you get that connection
string? Do you build it yourself (in Page_Load) or retrieve it from Session?

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top