gpt4 book ai didi

javascript - ASP.NET Ajax 错误 : Sys. WebForms.PageRequestManagerParserErrorException

转载 作者:行者123 更新时间:2023-12-03 02:22:05 26 4
gpt4 key购买 nike

在尝试执行任何 Ajax 事件时,我的网站不断出现间歇性错误。我收到的消息是

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '

<!DOCTYPE html P'.

所以这显然是某种服务器超时或者服务器只是返回了损坏的垃圾。不幸的是,这种情况通常会发生

最佳答案

Eilon Lipton 有一篇出色的博客文章。它包含许多关于如何避免此错误的提示:

<强> Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

也请阅读评论。有人有同样问题的评论:“我解决了它,改变了 IIS 上应用程序池的服务器空闲时间。它只有 5,所以我增加了它,现在可以工作了。”

“UpdatePanel 控件使用异步回发来控制渲染页面的哪些部分。它在客户端上使用一大堆 JavaScript 并在服务器上使用一大堆 C# 来实现这一点。

异步回发与常规回发完全相同,除了一件重要的事情:渲染。异步回发与常规页面经历相同的生命周期事件(这是我经常被问到的问题)。

只有在渲染阶段事情才会变得不同。我们仅捕获我们关心的 UpdatePanel 的渲染,并使用特殊格式将其发送到客户端。此外,我们还会发送一些其他信息,例如页面标题、隐藏的表单值、表单操作 URL 和脚本列表。”

该错误的最常见原因:

  1. 调用 Response.Write():
  2. 响应过滤器
  3. HttpModule
  4. 服务器跟踪已启用
  5. 调用 Server.Transfer()

关于javascript - ASP.NET Ajax 错误 : Sys. WebForms.PageRequestManagerParserErrorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/290121/

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