I’ll have an ASP.net page that creates some Excel Sheets and sends them to the user. The problem is, sometimes I get Http timeouts, presumably because the Request runs longer than executionTimeout (110 seconds per default).
I just wonder what my options are to prevent this, without wanting to generally increase the executionTimeout in web.config?
In PHP, set_time_limit exists which can be used in a function to extend its life, but I did not see anything like that in C#/ASP.net?
How do you handle long-running functions in ASP.net?
If you want to increase the execution timeout for this one request you can set
But you still may have the problem of the client timing out which you can’t reliably solve directly from the server. To get around that you could implement a ‘processing’ page (like Rob suggests) that posts back until the response is ready. Or you might want to look into AJAX to do something similar.