How do you set a break points in server tags in .aspx pages. e.g.
<% dim breakhere =new object() %>
The web application is running in debug mode with the <compilation debug="true" ...
in the web.config. But the page says:
The break point will not currently be hit. No symbols have been loaded for this document.
Is there anything else i need to set?
To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.
Breakpoints. Breakpoints specifies the runtime to run a specific line of code and then stop execution so that the code could be examined and perform various debugging jobs such as, changing the value of the variables, step through the codes, moving in and out of functions and methods etc.
Set a breakpoint on line 17. Run the app again. You can even debug the Razor Pages with markup and inspect the values of variables!
instead of setting the breakpoint directly, you could use
<% System.Diagnostics.Debugger.Break();
// more code here...
%>
Maybe a better suggestion though is to not put inline code in your markup - instead put it in a method in the code-behind file, and then call that method from your markup. In your method in the code-behind, you can use the breakpoints as you normally would.
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