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

前端 未结 4 652
渐次进展
渐次进展 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: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 :-)

提交回复
热议问题