Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Break points aspx pages

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?

like image 237
PhilHoy Avatar asked Nov 19 '08 11:11

PhilHoy


People also ask

How do you insert a break point?

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.

What is breakpoint in asp net?

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.

Can you debug razor pages?

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!


1 Answers

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.

like image 160
Scott Ivey Avatar answered Oct 21 '22 07:10

Scott Ivey