Al Pascual


Geo RSS
Geo Twitter Timeline

Blogs I read

<May 2008>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

How to fix Sys.WebForms.PageRequestManagerParserErrorException in AJAX 1.0

Last year I wrote a fix for AJAX 1.0 on my old blog, looks like many people found it helpful, I wanted to make sure people understood that issue only happened with ASP.NET AJAX 1.0. I cannot reproduce the same problem with AJAX 3.5.

You will encounter this issue when mixing callbacks and postbacks, as callbacks do not use Response.Write and there is not complete Requests to the server.

This is a bug on the MS ASP.NET 2.0 AJAX 1.0, is not that you are doing something wrong, the framework cannot handle the request validation and the exception is thrown. I found that you can catch the exception using the Script manager; information about it here: http://alpascual.com/blog/al/archive/2007/03/26/Code-Snip-_2200_Customizing-ScriptManager_2200_-to-detect-errors.aspx

Or better yet, you can disable the error by disabling the request validation. On top of the webform add: enableEventValidation="false"

UPDATE: setting enableEventValidation does not fix the problem in all the cases. The problem can be cause with a timer in your application as well.

Cheers

Al

Read it here

Read the complete post at http://weblogs.asp.net/albertpascual/archive/2008/04/22/how-to-fix-sys-webforms-pagerequestmanagerparsererrorexception-in-ajax-1-0.aspx