views:

2345

answers:

2

I want to set a breakpoint on the __DoPostBack method, but it's a pain to find the correct file to set the breakpoint in.

The method __DoPostBack is contained in an auto-generated js file called something like: ScriptResource.axd?d=P_lo2...

After a few post-backs visual studio gets littered with many of these files, and it's a bit of a bear to check which one the current page is referencing. Any thoughts?

A: 

If you using IE7 for testing you can use View -> Script Debugger -> Break on next statement and then just click the button that generates the event(__DoPostBack)

Alex Reitbort
A: 

TBH, I dont think there is much value in setting a breakpoint within the Javascript since it pretty much comes straight back to the server anyways.

It would be best to set breakpoints in your server code.. Depending on what you are trying to debug this will be in different places.. Either in the page event cycle or a controls IPostBackEventHandler.RaisePostBackEvent handler.

Rob Cooper
Some background. I have a control that calls __DoPostBack, which triggers all the AJAX components in an UpdatePanel to be disposed. However the linkButtons in the same panel call __DoPostBack, but the components don't dispose. The difference is in __DoPostBack somewhere (which does a lot of work).