Wednesday, September 22, 2010

Debugging AJAX in VS



To debug Ajax you have to do it as the code is executing in the browser.
You write out a debug message using Sys.Debug.trace.
Your page must include the Microsoft AJAX Library JavaScript file. This is done by adding a ScriptManager control to your page.

The following code shows part of an .aspx page that includes a ScriptManager control and a JavaScript function named button1_onclick.
When this function is fired (from the user clicking button1), the trace method is called.











You can view the trace messages output by the AJAX library in the Visual Studio Output window.




No comments:

Post a Comment