Carl Rippon
Carl Rippon

Reputation: 4673

Referencing CSS from a User Control

I have an ASP.NET user control that references some CSS classes. In the Error List pane I get the following warning for each CSS reference: The class or CssClass value is not defined. Is there any way around this?

Upvotes: 1

Views: 238

Answers (1)

user151323
user151323

Reputation:

Use this in your user controls. This will trick VS into thinking there is a stylesheet while avoiding at the same time it being included as a duplicate.

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

Upvotes: 2

Related Questions