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

有些话、适合烂在心里 提交于 2019-12-01 18:53:50

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.

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.

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

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 :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!