Whenever I trace the output of my site, I get the following error: sys.webforms.pagerequestmanagerparsererrorexception. message from the server cannot be parsed. common causes of this error are when the resposne is modified by calls to response.write, response filters, httpmodules, or server trace is eneabled.
Error parsing near [timer1,1000], etc......
and it's an alert pop-up, that continues to alert every second after I close it. Its really annoying.
The site works fine when trace isn't eneabled, but obviously trace is needed for debug reasons.
I can catch the trace event in Page.Trace.IsEnabled, but how do I destroy or deactivate the timer, or the scriptmanager, or whatever it is that causing all these javascript alerts?
Hi bbaxter,
In general trace won't "play nice" with ajax (as it alters the page by appending the trace information to it).
I'd suggest taking a look atthis page to see how Microsoft recommends handling Debug and Trace situations when Ajax is involved.
You can use thetrace viewer to avoid appending the information to the page.
Add something like this to your web config
<configuration>
<system.web>
<trace enabled="true" pageOutput="false" requestLimit="50" localOnly="false"/>
</system.web>
</configuration>
And surf to http://yourapplication/trace.axd
I hope that helps.
Page level Tracing is not enabled if the page contains UpdatePanel, Instead use Trace.axd.
Well, see I have a page class that only sets trace=true when the url contains a ?trace=1 argument.
Can't I programmatically just ignore the update panel when trace=1, or using page.trace.isenabled in the page load?
Basically what I'm saying is on every page of our site adding ?trace=1 makes the trace enabled, this is useful for testing and live because you can see the debug information. Is there a way to just make the popups stop... popping up? the trace isn't the problem I suppose, the popups caused by the timer are.
Hi bbaxter,
Ah I see...I'd suggest looking at migrating to the suggested way of doing this. Any use of updates panels and trace will cause the errors you are seeing. There may be a way to eat those exceptions (I'm not aware of one) but it's not going to update the updatepanel, making it rather pointless.
I think the best way is probably to set the EnablePartialRendering property on your script manager to false wherever you're manually turning on tracing. That will eliminate the ability for updatepanels to do asynchronous postbacks. You probably also want to set the Timer.Enabled property to false or change its Interval to something longer as it'll cause regular postbacks that will refresh the page.
I hope that helps.
No comments:
Post a Comment