Search code examples
asp.netsharepointsharepoint-2010

UpdatePanel async postback causes infinite HTTP POST loop and PageRequestManagerParserErrorException


Problem:

  • In Sharepoint 2010 ASP.NET page there is an UpdatePanel async postback that is doing an infinite HTTP POST loop after the HTTP GET page load.
    • All HTTP GET (the initial page load) and HTTP POST (update panel post back) operations are receiving HTTP/1.1 200 OK.
  • Error messages that can be seen in web browser console after HTTP POST's HTTP/1.1 200 OK response has been received:

Error: 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 '<partial text string from __VIEWSTATE variable's value>'.

Update panel HTTP response delimiter data format:

In HTTP POST's response I noticed that pipe ("|") delimited format's (<content length>|<type>|<control ID>|<content text>) HTML content's content length is smaller than HTML content text's actual length. HTML content contains UTF-8 data so character length and byte length is different. However taking this into count doesn't seem to make the lengths match either.

Some information found in the Internet about update panel HTTP response format, but I can't seem to find detailed format specifications nor detailed parser behavior information:

Questions specific to response’s pipe delimiter format:

  • Is format's <content length> meaning byte length, character length or something else?
  • Has the parser behavior been specified in case <content length> does not match with <content text>? Can the parser survive it?
  • I've tried extensive searching but haven't find specifications about UpdatePanel response's pipe delimited format. Are there any detailed format and parser specifications?

General question:

Previous questions are based on assumption that the content length mismatch could cause the PageRequestManagerParserErrorException and the infinite HTTP POST loop.

Are there some other possibilities that could cause this infinite loop issue?


Solution

  • Issue got resolved. I'll answer here to some of the questions that were raised.

    Are there some other possibilities that could cause this infinite loop issue?

    Loop was caused by the parser error in this case. The root cause was that HTTP data routing software was changed in between. The new software modified UpdatePanel HTTP response data before reaching to the end-user's web browser which caused malformation of the data and parser error.

    Is format's meaning byte length, character length or something else?

    It's character length.

    I've tried extensive searching but haven't find specifications about UpdatePanel response's pipe delimited format. Are there any detailed format and parser specifications?

    Has the parser behavior been specified in case does not match with ? Can the parser survive it?

    Couldn't find specifications, but it seems that the parser doesn't survive if the content length differs.