Wednesday, April 15, 2009

Ways to fix PageRequestManagerParserErrorException

I created a web app that retrieves data from a binary column in sql server. In order to convert the data in that column I created an HttpHandler, but I had to pass an ID to the HttpHandler to pull the right row from the database. I decided to pass the ID via the session, but once I added the code for the Session variable I started getting this weird error the very first time I would run my app: "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. comonn causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled."

I did a lot of looking around on the interwebs and found two sites that eventually landed me a solution I was happy with. This first blog suggested adding EnableEventValidation="False" to the top of the .aspx page, which did stop my error, but I wasn't comforatable doing this. I did some searching through the comments of this second blog and found out that all I needed to do was "initialize" my session variable, and that ended up working really well for me.

No comments:

Post a Comment