This is some kind of annoyance for me for a while. I pretty much use partial views in MVC, and I use Visual Studio 2008 for development. The problem is that when I give the html elements a class in the partial view ( <div class="someClass">), it will underline them in green, as if it does not know what they are.
I understand that this is due to the fact that I am in a partial view and did not put tag links in this file to find out where CSS is located (link tags are in the main view, which displays a partial view), CSS still works fine on my site, because the browser will display all the views as one long html page anyway, but it’s very annoying to view my partial views and view all my classes highlighted in green.
Is there a way I can still tell Visual Studio that these classes exist somewhere, from a partial view? I decided there should be a way to communicate this, but I'm not sure what it is. Maybe a way to import style sheets from the parent view?
source
share