Set the running timeout for asp.net pages detail to a single page and site _ Practical Tips

Source: Internet
Author: User

Global Timeout Time

If you have more than one Web site on the server, you want to set the timeout time uniformly, you need to set the Executiontimeout property value in the Machine.config file.
The Machine.config file is located in the%systemroot%\microsoft.net\framework\%versionnumber%\config\ directory.
For example:

Copy Code code as follows:


Single site timeout time

To set the HTTP request run time in the Web.config configuration file:
Copy Code code as follows:

<system.web>
</system.web>

Set here for 720 seconds, the previous attribute maxRequestLength is generally used for user upload file limit size! The default is typically 4096 KB (4 MB).

single page Request Timeout

For a single page, you can use Server.ScriptTimeout to set the timeout.
Copy Code code as follows:

Server.ScriptTimeout = 120;

Note: If you set the Debug property in Web.config, for example: <compilation debug= "true" targetframework= "4.0" >
At this point, ScriptTimeout will be ignored.

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.