11

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?

Kent Fredric
  • 56,416
  • 14
  • 107
  • 150
PhilHoy
  • 1,613
  • 1
  • 12
  • 20

2 Answers2

28

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.

Scott Ivey
  • 40,768
  • 21
  • 80
  • 118
-1

I havent tried this myself but in ASP (VBScript) you can inject a STOP statement and that will trigger the IDE to break on that line

Example

<%
STOP
Dim o as Object = new Object()
%>

HTH

rams
  • 6,381
  • 8
  • 46
  • 65