Reputation: 103
I have a aspx web page using a master page. There is a style.css sheet which is a global style. How can I override the style for all the content in the aspx page, but not alter anything else?
so for example something like this in the aspx page
<asp:Content overridestyle = true>
...
</asp:Content>
EDIT
I found something that sort of sort of works, but it removes the style for the entire page, including the content on the masterpage. Is there anyway to do this solution but only for the content in the contentplaceholder?
new protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "";
}
Upvotes: 1
Views: 2827
Reputation: 468
Add the Content place holder in the master page like this under section
<head runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>
</head>
in your aspx page,
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<link href="*****style sheet path****" rel="stylesheet" type="text/css" />
</asp:Content>
Upvotes: 3