I don’t know exactly why, but I’ve never been able to set any breakpoint directly into my MVC views while using Visual Studio 2010. Although it allows you to do so into the razor code blocks, it doesn’t seem to work well when dealing with inline razor code.
Thankfully, new Visual Studio RC 2012 allows you to set any breakpoints in your views no matter where they are placed inside the view, but if you still work with Visual Studio 2010 and you haven’t still solved this problem, this will come very handy.
Here you can find a very nice post talking about this issue and how to avoid it.
Just a quick hack for everyone of you which are wondering how to get a well formed tag using asp.net. It turns out that our beloved Label control can render as a span or as a label.
All you have to do to change its behaviour is to fill the Label property AssociatedControlID with the id of the control you want to bind.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.