Debugging JavaScript in VS.NET for ASP.NET application

Debugging JavaScript in VS.NET for ASP.NET application

The following tip will explain how you can setup your JavaScript code to be debugged in VS.NET.

  • Create a file named something.js and then add all your JavaScript functions to this file.

  • Add the js file to your ASP.NET project.

  • Then in every ASP.NET page that will call one of those functions add the following line to the HEAD section of the page. <script lanaguage=“javascript“ src=“something.js“></script>

  • Before running the solution in debug mode set a break point in the .js file where you would like it to stop.
  • Now run the solution in debug mode and VS.NET will break at that point every time the application executes that code.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish