Saturday, July 07, 2007

Asp.Net Ajax Debugging

Dan Walhin made this good video tutorial to show us steps needed to debug client side script :
Video : Debugging ASP.net Ajax Application with Visual Studio 2005



Basically, The following steps need to be performed
Step1: Need to tweak IE to enable client script debugging :Go to Tools > Internet Options > Advanced and uncheck both "Disable script debugging (Internet Explorer)" and "Disable script debugging (Other)" .





Step2:Then in your client code where you want the breakpoint write debug.fail("Something") Microsoft AJAX method to launch debugging, with this message "There is no source code available for the current location",



Step3:Please use the Script Explorer window (Debug > Windows > Script Explorer) to get a list of all loaded Js scripts
[Note: if you can't find Script Explorer window check this in VS2005( Tools > Customize>Go to Commands Tab> Choose Debug from the left listbox> You will see Script Explorer on the right listbox> Drag the ScriptExplorer to your desired menubar)





Step4:then you can select any one of the loaded js scrips, debug and step-in your client code and also into the AJAX Framework!

No comments:

Post a Comment