c# - ajax超时问题

标签 c# asp.net asp.net-ajax

我在 ajax 中有很长的过程导致问题 我在脚本管理器中添加了 asyncpostbacktimeout=600

<asp:ScriptManager AsyncPostBackTimeOut="600" runat="server" ID="SmPage" EnablePageMethods="true" />

在本地主机上运行良好, 但是当我在服务器上测试它时它仍然有一些问题

有什么建议吗? 谢谢

最佳答案

您可能必须在 web.config 中增加 executionTimeout,否则请求本身会超时。

看看executionTimeout在 msdn。它解释了 Debug=True/False 之间的区别,这可能导致本地主机和生产之间的差异。

executionTimeout Optional Int32 attribute.

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.

The default is 110 seconds.

executionTimeout 添加到 Web.Config 中的 configuration/system.web/httpRuntime 并让我知道它是否有效:

<configuration>
  <system.web>
    <httpRuntime executionTimeout="600" />
  </system.web>
</configuration>

关于c# - ajax超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7282811/

相关文章:

c# - 难以理解重载类构造函数的语法

asp.net - 从 URL 获取变量并将其传递给 SqlDataSource SelectCommand

asp.net - 密码强度定位问题

asp.net - 使用 ajax 触发异步调用时复选框选中事件的事件名称是什么?

c# - 如何拆分数组中的元素并将其作为新数组返回

c# - 如何将格式为月/日/年时间的字符串化日期值转换为日期时间?

c# - 检查 Linked list<Node<T>> 是否包含某个节点

javascript - Knockout 和 ASP.NET MVC 多页面

c# - 关于文本框验证

jquery - 数据表中的复选框选中状态