[ACCEPTED]-Apply CSS to Content Page in Asp.NET-css

Accepted answer
Score: 51

Normally I put a content placeholder in 6 the head section of the master page. That 5 way any content page can add extra css/js/etc 4 references to the head of the page.

In your 3 master page put the following

<head>
  ... title, meta tags, js and css links ...
  <asp:contentPlaceholder id="head" runat="server" />
</head>

Then in your 2 pages you can include extra elements in 1 the head using this

<asp:content contentplaceholderid="head" runat="server">
 <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
</asp:content>
Score: 5

Put a content placeholder in the head portion 4 of your master page. Not all content pages 3 will need to place anything in it but this 2 particular content page can place the CSS 1 file you want to link.

Score: 2

You can't apply a style sheet to a content 1 page only, it applies to the whole web page.

More Related questions