Friday, October 16, 2009

Sys.WebForms.PageRequestManagerParserErrorException and HttpContext Trace

Recently I started getting the following error from UpdatePanels in a ASP.NET site.

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 '[initialvalue']|""|<div id="__asptrace"'.

Happily the error message pretty much points me straight at the issue: "server trace is enabled" and "__asptrace".

Turning the ASP.NET server trace off resolves the issue.

<trace enabled="true" pageOutput="false" requestLimit="40" traceMode="SortByTime" localOnly="true"/>