Why can't I set a breakpoint in a ASP.NET view?

前端 未结 4 613
渐次进展
渐次进展 2021-01-19 02:24

If I set a breakpoint in the compiled code (for instance in an action), I can then step through, and eventually am stepping through the generation of the View.

I\'v

相关标签:
4条回答
  • 2021-01-19 03:02

    Another thing that comes to my mind is to use the debugger; keyword in the view, though I am not 100% sure it will work as in ASP.NET ajax site.

    0 讨论(0)
  • 2021-01-19 03:08

    UpTheCreek,

    Not really a 'nice' way to do it, however, you can insert some 'flip-flop' code in your view that CAN have a breakpoint placed in it and then step from there. This code doesn't neccessarily have to perfom a function (tho obviously, would be useful if it did).

    anyway, you don't want the crumbs, so here's the (meal) deal:

    <%
        int rspId = 0;
        string uniqPageId = Guid.NewGuid().ToString().Replace("-", "");  
    %>
    

    then, simply place the breakpoint at the side of any of those variable definitions.

    Not clean and definately a 'jfar' markdown candidate :-)

    0 讨论(0)
  • 2021-01-19 03:11

    Click to the code where you want to debug and than press F9.

    0 讨论(0)
  • 2021-01-19 03:14

    Right click on the code you want to break on and go to "Breakpoint -> Insert Breakpoint".

    Why? Must have something to do with the face your not working with a pure code file and hitting the left sidebar doesn't know which block of code to use.

    0 讨论(0)
提交回复
热议问题