views:

1865

answers:

4

Is there a way to manually increase / decrease the timeout of a specific aspx page?

+1  A: 

In the web.config:

   <configuration>
      <location path="~/Default.aspx">
        <system.web>
          <httpRuntime executionTimeout="1000"/>      
        </system.web>    
      </location>
   </configuration>
mnour
A: 

If you are talking about the amount of time it takes before the page returns a timeout, then mnour's example - you may want to look at the machine.config file as well. If you talking about a session timing out, then you will need to use a JS timer that posts back when it reaches 0.

schmoopy
A: 

http://stackoverflow.com/questions/184782/aspnet-session-timeout-testing

Do a search, there is a lot of posts about this subject.

VP
+1  A: 

The one thing to remember with this is that the timeout feature here will only invalidate the Session Timeout, but the user will still remain on whatever page they are on. This may cause issues with the flow of the application. As a rememdy, I keep the following in my Web.config file:

<appSettings>
     <!-- Application Timeout is 10 minutes -->
     <add key="SessionTimeoutMilliseconds" value="600000"/>     
</appSettings>

In addition, my master page has the following code in my code behind file:

' Register Javascript timeout event to redirect to the login page after inactivity
Page.ClientScript.RegisterStartupScript(Me.GetType, "TimeoutScript", _
                                        "setTimeout(""top.location.href = '/EAF/Login.aspx'""," & _
                                        ConfigurationManager.AppSettings("SessionTimeoutMilliseconds") & ");", True)

and you should be all set on both ends.

Dillie-O
This in no way provides an aswer to the question, as it simply redirects to login, no extending of the timeout values
Mitchel Sellers
Well, serves me right for misreading. 8^D Looks like the first responder did the same thing. I've modified the question title to help better reflect the question at hand.
Dillie-O