VS2012 MVC 4 Intellisense for CSS classes in partial views not working

PROBLEM:

I have a master page that has CSS embedded and I am trying to access CSS classes via VS2012 intellisense on my partial views.

RESEARCH AND SOLUTIONS:

I have spent many hours trying to solve this problem and have noted a number of other stackoverflow posts regarding this issue:

Viewing CSS Intellisense in Partial Views and Content Pages - Visual Studio 2010?

http://weblogs.asp.net/jeffwids/archive/2009/06/07/why-does-visual-studio-not-resolve-my-css-class-names.aspx

Why doesn't Visual Studio resolve CSS class names?

http://derekreynolds.wordpress.com/2012/11/30/why-does-visual-studio-not-resolve-my-css-class-names-or-js-method-names/

someone also posted a video which had the EXACT problem I was facing: http://www.youtube.com/watch?v=1bp1TxswSHQ

Suggested solutions is to use relative path using @if (false) {... trick on the partial view page:

@if (false) {
    <link type="text/css" rel="Stylesheet" href="../../content/css/styles.css"/>
}

      

OR to use the following on a partial image:

<link rel="stylesheet" runat="server" media="screen" href="~/content/css/styles.css" />

      

None of them seem to work for me.

I am using VS 2012 Express.

Any ideas?

+3


source to share


1 answer


It seems that css intellisense in .cshtml files is not supported in VS 2012.

http://connect.microsoft.com/VisualStudio/feedback/details/790808/no-intellisense-in-html-editor-to-show-the-classes-in-my-css-file



I tried in VS 2013 RC and it worked as expected.

+2


source







All Articles