views:

27

answers:

2

Hi,

I'm currently working on a page which makes use of the MS Ajax UpdatePanel. However I've run into a strange problem. If I simply compile and view my page, one of the button click events results in an error. However, because the button affects items inside an UpdatePanel the actual exception is hidden from me: all I'm getting is a HTTP 500 error returned to me through the UpdatePanel Javascript.

What's odd about this is that if I step through the code line by line in Visual Studio, I don't get the error. The button doesn't cause the behaviour I'm expecting, but it throws no errors.

Because the step through isn't causing an error to be thrown, I'm at a loss how I can get to the actual exception message so I can find out where the error is being thrown and debug it. Suggestions gratefully received.

Cheers, Matt

A: 

Enable custom errors in web.config, that should output the stack trace and the exception info on the response:

<configuration>
 <system.web>
  ...
  <customErrors mode="On" />
  ...
 </system.web>
</configuration>

Remember to turn off the errors when deploying to production to hide implementation details to users in case of errors.

Anero
Thanks for the suggestion, but it's not doing anything I'm afraid. Still getting the javascript popup.
Matt Thrower
A: 

You can still use firebug to see the body of the http response (see network tab). Or you can disable javascript and your page will work javascript(ajax)less...

firebug Web developer toolbar to disable/enable js easily

remi bourgarel
If I disable javascript, I can't click the button to trigger the ajax call.This is driving me crazy :(
Matt Thrower
and with firebug ?
remi bourgarel