Sys.WebForms.PageRequestManagerParserErrorException

passA partial-page update is initiated by a client request (an asynchronous postback) to the server. The server processes the request and returns a response to the client.

If the browser does not receive a response in a specified time, the Sys.WebForms.PageRequestManagerTimeoutException is raised. To change the interval that elapses before asynchronous postbacks time out, set the AsyncPostBackTimeout property of the ScriptManager control.

If an error occurs on the server while the request is being processed, an error response is returned to the browser and the Sys.WebForms.PageRequestManagerServerErrorException exception is raised. To customize error handling and to display more information about the server error, handle the AsyncPostBackError event and use the AsyncPostBackErrorMessage and AllowCustomErrorsRedirect properties. For an example of how to provide custom error handling during partial-page updates, see Customizing Error Handling for UpdatePanel Controls.

If the response to an asynchronous postback returns without an error but there is an error processing the response in the client, the Sys.WebForms.PageRequestManagerParserErrorException is raised. For information about how to handle this error condition, see ASP.NET AJAX Debugging and Tracing Overview.

How to avoid this problem:

1. Calls to Response.Write():
Place an or similar control on your page and set its Text property. The added benefit is that your pages will be valid HTML. When using Response.Write() you typically end up with pages that contain invalid markup.

2. Response filters:
The fix might just be to not use the filter. They’re not used very often anyway. If possible, filter things at the control level and not at the response level.

3. HttpModules:
Same as response filters.

4. Server trace is enabled:
Use some other form of tracing, such as writing to a log file, the Windows event log, or a custom mechanism.

5. Calls to Server.Transfer():
I’m not really sure why people use Server.Transfer() at all. Perhaps it’s a legacy thing from Classic ASP. I’d suggest using Response.Redirect() with query string parameters or cross-page posting.

Another way to avoid the parse error is to do a regular postback instead of an asynchronous postback. For example, if you have a button that absolutely must do a Server.Transfer(), make it do regular postbacks. There are a number of ways of doing this:

1. The easiest is to simply place the button outside of any UpdatePanels. Unfortunately the layout of your page might not allow for this.
2. Add a PostBackTrigger to your UpdatePanel that points at the button. This works great if the button is declared statically through markup on the page.
3. Call ScriptManager.RegisterPostBackControl() and pass in the button in question. This is the best solution for controls that are added dynamically, such as those inside a repeating template.

Support: http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx#1820815

Hope it will resolve this problem. You can add your comments here.

Regards,
Vijay Modi

Advertisements

About Vijay Modi

Having 12+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

14 Responses to Sys.WebForms.PageRequestManagerParserErrorException

  1. Jason says:

    This problem also occurs very specifically with update panels when setting session variables. The website thread I linked has a solution to this problem. The difference between the problem linked and problem here is the absence of the methods you listed being used with the same symptoms.

  2. Lawrence says:

    Hi,
    I don’t know to wich categories this belongs but SmartNavigation=”true” seems to cause also a “Sys.WebForms.PageRequestManagerParserErrorException”.

    Just some tip if you looking for hours just as I did 😉

    Grtz

  3. Marsouin says:

    The new URL to the ASP.NET AJAX Website article about debugging and tracing :

    http://ajax.asp.net/docs/overview/ASPNETAJAXDebuggingAndTracingOverview.aspx

  4. Shaun Peet says:

    Check your firewall settings too!

    Solution Posted On Telerik Blogs

  5. Mark Kamoski says:

    That is some nice information on how to avoid the error. However, sometimes, this error may be absolutely unavoidable. For example, suppose the case where an Ajax partial-post calls to a database and suppose the database is offline due to a reboot. In such a case, the modal popup will appear in IE to the enduser, who must dismiss it. Furthermore, such popups will stack, such as when the Ajax calls are frequent, such as in a chat application’s polling. My question is– what can be done to CATCH the error, avoid the modal message box stacking, and redirect to show a generic error page? Please advise. Thank you. — Mark Kamoski

  6. Shane says:

    I find i only get the error when i have dynamically generated the controls. If i hard code the controls into the aspx page, i don’t get it. If i dynamically generate the controls in the code page then i get the problem on the whole page. I don’t know the answer but maybe this helps.

  7. BlueG says:

    Can someone give me a tip for this problem?:
    I have textbox with user login, button “OK” and updatePanel with label (error messages).
    I change login, hit “OK”. Server checks, if changed login is available (must be unique).
    – if no, error is shown /* { lblError.Visible=true; updPnlError.Update() } */ – THIS WORKS FINE
    – if login is available, i save change and than I WANT TO REDIRECT TO ANOTHER PAGE – How can i do that?? (In (STUPID) IE7, Server.Transfer() and Response.Redirect() don’t work – both shows the PageRequestManagerParserErrorException)
    Thx..

  8. nikeeta says:

    yeah i am also facing similar problem, when i click on submit button , it interacts with database… some time it works fine, some times it throws same exception with error code 425…, i really dont understand what to do, becoz thre is no problem in coding.. i ma so sure abt this becoz if there would have problem then every time it would have throw exception which is not happening, one solution i found that to set “enable event validation to false” but this may also cause security issue, hence can not implement this.. can any one give some solution on this pls?

  9. Steve says:

    “I’m not really sure why people use Server.Transfer() at all.” Fail.

  10. Nick says:

    I searched every where on internet and every blog got the same answer as above…..I don’t know who copied whom……But no one explained or gave example of how to avoid this error.
    I don’t know whether someone can truely com up with some perfect solution.
    Since this post is created on Apr 13 2007, so the author here copied it from somewhere else bcz I find many more post with the same suggestions….
    Please, try work on the problem first and then giv ur suggestions.

  11. marta says:

    Why Server.Transfer() is so wrong?

  12. LUCI says:

    why copy/ paste? who said anything about a button? for example i have this error without a button, so myu only conclusion is that you copied this from other blog. Can’t you just find your own solution to this error?

  13. Vijay Modi says:

    Thanks LUCI.

    LOL
    🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s