Set the running timeout time for ASP. NET pages to a single page and site

Source: Internet
Author: User

Global timeout

If you have multiple websites on the server and want to set the timeout time in a unified manner, you need to set the ExecutionTimeout attribute value in the Machine. config file.
The Machine. config file is located in the % SystemRoot % \ Microsoft. NET \ Framework \ % VersionNumber % \ CONFIG \ directory.
For example:
Copy codeThe Code is as follows:
<HttpRuntime executionTimeout = "90" maxRequestLength = "4096" timeout = "false" minFreeThreads = "8" minLocalRequestFreeThreads = "4" appRequestQueueLimit = "100"/>

Time-out period of a single site

Set the http request runtime in the Web. config configuration file:
Copy codeThe Code is as follows:
<System. web>
<HttpRuntime maxRequestLength = "102400" executionTimeout = "720"/>
</System. web>

The value is set to 720 seconds. The preceding maxRequestLength attribute is generally used to limit the size of uploaded files! The default value is generally 4096 KB (4 MB ).

Single page request timeout

For a single page, you can use Server. ScriptTimeout to set the timeout.
Copy codeThe Code is as follows:
Server. ScriptTimeout = 120;

Note: If the debug attribute is set in Web. config, for example, <compilation debug = "true" targetFramework = "4.0">
In this case, ScriptTimeout is ignored.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.