views:

75

answers:

1

We've got a report that is being generated and served in real time when a user clicks on a link.

Of course, after we go live, we've discovered that some users have enough data to cause the report to run slowly enough that there is a timeout.

Longer term, we'll solve this by just creating a page that looks for the completed report periodically, and loads it up when it's ready. But for now, if it's possible, we'd like a quick fix to solve the immediate problem.

Is there a way to extend the timeout period for the single webpage being served up?

I found this which seemed to indicate it was sort of possible (but which seems like a very bad idea, because it changes the entire website for the duration of the web call, and worse, it seems like it might have problems with multiple hit synchronization as well, possibly leaving the longer timeout on for the entire site)

I also found this locally, but it didn't end up answering the question (though it did offer the longer term solution that we'll be moving toward.)

+1  A: 

If the page is in (or can be moved to) its own directory, you can put a web.config in that directory with just the executionTimeout or any other settings you want to extend. I.e.

<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
      <!-- allow for intensive calculations in reports -->
      <httpRuntime executionTimeout="6000" /> 
    </system.web>
</configuration>

According to one of the commenters on the first link you provided, setting Server.ScriptTimeout = 3600; is not a global change, so you may want to reconsider that option as well.

Gerald wrote re: Timeout of an ASP.NET page
on Wed, Nov 29 2006 3:38 PM
I decided to check the validity of this by writing a test program containing two pages. In one of the pages I am setting the ScriptTimeout property to 3000, while in the other page the value of the property is not changed. It turns out that after loading the first page, then the second page, the value of the ScriptTimeout in the second page is reverted to its default value (90 seconds for release, 30000000 for debug) or the value set in the configuration files. In conclusion, the ScriptTimeout property, when changed in one page, does not change at a Global level.

jball
Two good answers in one. Wish I could vote you up twice. Will come back to accept after I give these a go.
Beska
Right on. Now I just need to have a string (or a ball and chain) tied around my finger to make sure this gets fixed the right way eventually. Many thanks.
Beska
(For the record, I used the second of the two options, but I suspect the first would have worked just as well.)
Beska
Glad to help - I've been dealing with report timeouts this week as well, so I happened to have just setup the first solution.
jball