长时间执行ASP.NET导致错误“The Server Request timed out”错误

本文解决在ASP.NET页面上执行大数据读取和显示时遇到的请求超时错误,通过修改Web.Config或Machine.Config文件配置解决。

如果你要在一个ASP.NET页面之上执行大数据的读取和显示,那么你就很可能接收到如下错误信息:

Server Error in '/' Application.
Request timed out.
Description: An unhandled exception occurred during the executionof the current web request. Please review the stack trace for moreinformation about the error and where it originated in thecode.
Exception Details: System.Web.HttpException: Request timedout.
Source Error: An unhandled exception was generated during theexecution of the current web request. Information regarding theorigin and location of the exception can be identified using theexception stack trace below.
Stack Trace: [HttpException (0x80004005): Request timedout.]

解决方法:

修改Web.Config或者Machine.Config文件中的配置即可!

<configuration>
<system.web>
<httpRuntime=20 executionTimeout="36000" />
</system.web>
</configuration>

Exception Details: System.Web.HttpException: Request timed out.

In .NET, there is an additional setting for this. The default script timeout is set to 90 seconds by the httpRuntime section of the machine.config file. You can change this setting to affect all applications on your site, or you can override the settings in your application-specific web.config as follows:

<system.web>
<httpRuntime executionTimeout="900" />
</system.web>

The .NET config files are usually stored in the folder C:\Windows\Microsoft.NET\Framework\[version]\Config where [version] is the version of the .NET Framework such as v1.1.4322. You may need to restart IIS for such changes to take effect.

httpRuntime Element (ASP.NET Settings Schema)

http://msdn.microsoft.com/en-us/library/e1f13641.aspx

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值