Tuesday, April 26, 2011

Sys.WebForms.PageRequestManagerParserErrorException error - ASP.NET Ajax 1.0

Error Message : 
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 PUB'.

Have you ever got these kind of error when you are doing an Async postback using AJAX.NET .Actually If you’ve seen this error, you’ve probably already spent some time to resolve it. Anyway The solution mentioned below is worked for me. 

1) Make sure this in is your web.config
   <httpModules>
      <add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions,               Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35?/>
   </httpModules>

2) Add this to the to the Page declaration if you’re experiencing some page refresh bugs
   enableEventValidation=”false”


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


If you’ve found alternatives to this problem or our suggested solution isn’t working for you, please feel free to comment below.

2 comments:

Math_001 said...

Thank you so much!!! I have been struggling with this for so long.

Udit Gupta said...

It did not work for me. Actually i have a ajax post back in which i am modifying the contents via response filters.
To make it work i have to modify the length parameter in response HTML content.

For e.g.
1|#||4|4493|updatePanel|ctl00_ContentPlaceHolder1_ctl01_ctl01_upQuestions1|

here changed 4493 to the new length of the new content to work.

However this case will fail if i have multiple update panels in my page.

The solution you suggested above did not work.

Please let me know if you have a solution for this.

Post a Comment