views:

497

answers:

1

Hi there.

I've noticed that to get CSS-Intellisense working in VS, the paths have to be relative - Is this the case?

However, it seems

<link href="/resources/test.css" [...] />

is far more practical than

<link href="resources/test.css" [...] />

I'm including the CSS in the master page, and don't see much good in including it as a content block, just to get the relative paths correct for each directory depth. I've had a quick try with inline code resolving the path, but no dice there either (for Intellisense).

I feel I'm missing something fairly simple - What's the correct approach here to have CSS Intellisense work across the pages in the app during dev, and render fine in any deployed state?

Cheers.

(Note - I'm aware that a <% if (false) { %> type hack is required for user controls)

+1  A: 

I know this is an older question, but this works fine in VS2008. If my memory serves me correctly it was fixed in a hotfix a while back:

alt text

The other alternative ( if this isn't working for you still ) is adding a runat="server" and the tilde "~"

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

This worked for me. YMMV

Atømix