tags:

views:

494

answers:

5

What's the best way to put the "debugger;" statement inside the __doPostBack method or a way to step in the method?

+1  A: 

__doPastBack is still javascript running in the browser.

While it's possible to debug javascript using visual studio and IE, if you want to set a break point you need to be able to open the javascript in visual studio. You can' do that for __doPostBack because it's generated by the compiler.

However, if you view the page in firefox you can use the firebug extension to set break points in the browser after the page loads.

Joel Coehoorn
IE8 beta has the script debugging ability now if FF is not a choice. Also see about DebugBar for IE 7 if thats yer target.
StingyJack
I understand it's generated by .net, hence my question. Some third party controls have their Javascript in files and I can modify it and was wondering if asp.net had anything similar. I know that .net can be debugged but that seems overkill and probably very time consuming.
Abdu
I ran the app in VS 2008 in debug mode and then in IE7 I went view->script debugger->open and added a breakpoint inside __doPastBack from VS and it didn't trigger. IE7 has script debugging enabled.
Abdu
A: 

In IE you can go to internet settings -> advanced -> and uncheck the "Disable Javascript debugging" boxes. This will allow you to put a breakpoint in the JS code.

This is not about enabling/disabling debugging. It's about debugging JS generated by .NET.
Abdu
A: 

You can manually attach to the iexplore.exe process as Script debugger and set the breakpoint accordingly on generated page. Or you could break into debugger anytime by selecting the option from menu if you had enabled script debugging in advanced tab in Internet options

Mehrdad Afshari
A: 

It really is just a lot easier to use FireBug inside of FireFox and you don't have to go through a lot of nonsense.

BobbyShaftoe
A: 

Another option for JS debugging and FireFox (which I use a lot) is to use venkman. You can get it as FF extension right here.

MK_Dev