gpt4 book ai didi

asp.net - 如何增加 ASP.NET Ajax PageMethod 的超时时间?

转载 作者:行者123 更新时间:2023-12-04 06:36:29 25 4
gpt4 key购买 nike

我有一个 ASP.NET 页面,其中有几个用 [WebMethod] 装饰的静态方法。在旁边的代码中,它反过来使用 PageMethods.MyMethodName(myParameter, myOnCompleteHandler, myOnErrorHander); 从 javascript 调用.

其中一种方法被多次调用,由于调用量大,运行时间可能会很长。目前,该方法运行正常,但需要 5 分钟以上才能完成的调用超时。我想将该跨度增加到 10 分钟。

我试过了:

  • ScriptManager.AsyncPostBackTimeout = 600;
  • Server.ScriptTimeout = 600;
  • this.Page.AsyncTimeout = new TimeSpan(0,10,0);
  • Sys.Net.WebRequestManager.set_defaultTimeout(600000);在 javascript 中
  • 最佳答案

    将以下行添加到 system.web 部分中的 web.config。

    <httpRuntime executionTimeout="3600" maxRequestLength="2147483647" />

    迟到的回应,但也许这会帮助下一个人。

    关于asp.net - 如何增加 ASP.NET Ajax PageMethod 的超时时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4819396/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com