I can't seem to get Javascript debugging working for my ASP.NET MVC application even though I can for a traditional ASP.NET WebForm app.
I have followed the steps for unchecking the 'Disable Script Debugging' boxes for both IE and other.
when I add a simple function to display an alert in both the site.master and any content view the breakpoint will not fire.
Have i missed something obvious or do I need to use an outside tool for debugging like FireBug?
By the way, I'm using Visual Studio Web Developer Express 2008.
thx
function test()
{
debugger;
alert("hi");
}
I don't know if it will work with express, but when IE hits the "debugger" instruction, it asks me if I want to debug, and with wich tool. Visual studio is present in the list of options presented to me.
I don't know if express will be present for you though.
"debugger" also works with firebug.
I just had this problem today as well. The debugger doesn't know where you script files are if you include them in the mvc view.
Put them in an external .js
file (say default.js
) in the scripts folder, add a script tag in the site.master and then you will hit your breakpoints.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With