Contrary to popular belief, you can set breakpoints in ASPX views.
In Visual Studio, you can move the cursor to the right place, press F9 (Toggle Breakpoint) and do it.
This can be done in Razor and ASPX views, and even on ASPX pages (in WebForms).
If you CANNOT set a breakpoint, this means that this part is not C # code, but part of HTML. You cannot set breakpoints in parts like <span> , you can only set it between the stupid parts <% and %> (in Razor it is @{...} , @(...) or just @... ).
Also make sure that your application is built and the debugger is connected to the server instance (if it switches to Development Server in the project properties and vica-versa on IIS express).
Stop the development server instances in the taskbar, rebuild your project, and run it again. It should just hit a breakpoint.
source share