<p>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).</p>

<p>I just wonder what my options are to prevent this, without wanting to generally increase the executionTimeout in <code>web.config</code>?</p>

<p>In PHP, <a href="http://fr.php.net/manual/en/function.set-time-limit.php" rel="nofollow noreferrer"><code>set_time_limit</code></a> exists which can be used in a function to extend its life, but I did not see anything like that in C#/ASP.net?</p>

<p>How do you handle long-running functions in ASP.net?</p>

[{'answer_id': 29688, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 1, 'selected': False, 'text': '<p>I\'ve not really had to face this issue too much yet myself, so please keep that in mind.</p>\n\n<p>Is there not anyway you can run the process async and specify a callback method to occur once complete, and then keep the page in a "we are processing your request.." loop cycle. You could then open this up to add some nice UI enhancements as well.</p>\n\n<p>Just kinda thinking out loud. That would probably be the sort of thing I would like to do :)</p>\n'}, {'answer_id': 29754, 'author': 'John Hunter', 'author_id': 2253, 'author_profile': 'https://Stackoverflow.com/users/2253', 'pm_score': 5, 'selected': True, 'text': '<p>If you want to increase the execution timeout for this one request you can set</p>\n\n<pre><code>HttpContext.Current.Server.ScriptTimeout</code></pre>\n\n<p>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.</p>\n'}]
['https://Stackoverflow.com/questions/29686', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/91/']