ASP.NET Ajax错误:Sys.WebForms.PageRequestManagerParserErrorException [英] ASP.NET Ajax Error: Sys.WebForms.PageRequestManagerParserErrorException

查看:172
本文介绍了ASP.NET Ajax错误:Sys.WebForms.PageRequestManagerParserErrorException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站在尝试执行任何 Ajax活动时,一直在给我间歇性的错误。我得到的消息是

  Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器收到的消息。通过调用Response.Write(),启用响应过滤器,HttpModules或服务器跟踪来修改响应的常见原因。 

详细信息:在'

<!DOCTYPE html P'附近解析错误。

所以它显然是某种服务器超时或者服务器刚刚返回破碎的垃圾。这通常不幸的是,并不总是幸福。

解决方案

Eilon Lipton有一个很好的博客条目。它包含有关如何避免此错误的许多提示:



Sys.WebForms.PageRequestManagerParserErrorException - 它是什么以及如何避免它



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



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



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



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



该错误的常见原因



<
  • 调用Response.Write():

  • 响应过滤器

  • HttpModules

  • 启用服务器跟踪

  • 调用Server.Transfer()


  • My website has been giving me intermittent errors when trying to perform any Ajax activities. The message I get is

    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'.
    

    So its obviously some sort of server timeout or the server's just returning back mangled garbage. This generally, unfortunately not always, happe

    解决方案

    There is an excellent blog entry by Eilon Lipton. It contains of lot of tips on how to avoid this error:

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

    Read the comments too. There is a comment of somebody with the same problem: "I solved it changing server idle time of my app pool on IIS. It was only 5, so I incremented it and now works."

    "The UpdatePanel control uses asynchronous postbacks to control which parts of the page get rendered. It does this using a whole bunch of JavaScript on the client and a whole bunch of C# on the server.

    Asynchronous postbacks are exactly the same as regular postbacks except for one important thing: the rendering. Asynchronous postbacks go through the same life cycles events as regular pages (this is a question I get asked often).

    Only at the render phase do things get different. We capture the rendering of only the UpdatePanels that we care about and send it down to the client using a special format. In addition, we send out some other pieces of information, such as the page title, hidden form values, the form action URL, and lists of scripts."

    Most common reasons for that error:

    1. Calls to Response.Write():
    2. Response filters
    3. HttpModules
    4. Server trace is enabled
    5. Calls to Server.Transfer()

    这篇关于ASP.NET Ajax错误:Sys.WebForms.PageRequestManagerParserErrorException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆