Simon
Simon

Reputation: 5493

How to stop Visual Studio css intellisense breaking when css is added via a custom control

I have created a simple Asp.Net custom control which automatically combines all the correct stylesheets to send to the client (based on browser type/version/etc).

However, because at design-time the head tag looks something like this...

<head>
    <cc:CssControl runat="server" />
</head>

...VS is unable to provide intellisense for css class names. I've tried creating a ControlDesigner for the control that returns some hard-coded <link />'s by overridding GetDesignTimeHtml(), but that didn't seem to help either.

Anyone have any ideas for this?

Thanks,

Simon.

Upvotes: 2

Views: 1266

Answers (1)

Barbaros Alp
Barbaros Alp

Reputation: 6434

This css intellisense doesn't work in usercontrols. I have almost tried everything to get it worked.

But you can try it in the user control just like we include jquery intellisense in UserControl. I havent tried it out yet.

<% if (false) { %>
<link rel="Stylesheet" href="style.css" type="text/css" />
<% } %>

I Hope it works

Upvotes: 5

Related Questions