How can I add a css file to only a child page while using ASP.NET master pages rather then specifying them in the master?
In the master page
<head>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
In the specific page
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<link href="~/pagecssfile.css" rel="stylesheet" type="text/css" />
</asp:Content>
You can specify it in child page inside the content as mentioned below
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<link href="Css/main.css" rel="stylesheet" type="text/css" />
scope of this css will remain for this page only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With