August 8, 2007
AJAX RESPONSE Parsing Exception
Problem: In newly AJAX-enabled .Net 2.0 page, buttons that redirect user to another page are suddenly throwing the following 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 bycalls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near '<BODY><ASP_SMARTNAV_'.
Specifically, I had a small landing page with a few checkbox and a few buttons. I had wrapped these in an AJAX UpdatePanel. Below the panel is a Save button and a Reset button. These trigger updates to the UpdatePanel.
Solution: Eilon Lipton's Blog fully describes what is going on. My buttons inside the UpdatePanel were redirecting to another page. The fix was simple — add the buttons as regular PostBackTriggers so that the UpdatePanel would complete the postback properly.
Comments
Drew — October 12, 2007
Thanks for sharing your knowledge!
Saved me hours of banging my head on the keyboard :)