I have a master page which is being inherited to a lot of content page. I have one particular page in which I do NOT want one of the user controls present in the master page. I do NOT want to create a separate master page for this. I want to know if there's any way to prevent the user control present in master page being inherited to child / content page. Appreciate your help. thanks !
In the user control,
protected void Page_Init(object sender, EventArgs e)
{
Css.Register(this, "/css/reset.css", BrowserTarget.All, true);
}
In the master page, the user control is added
The part (css in reset.css) I'm trying to remove / prevent being inherited to the content page
ol, ul {
list-style: none;
}
In order for the control to never exist at all with what you're saying and your feedback that hidden doesn't fit your needs, I'm guessing removing the control won't either.
The only other option here is to change the master page to have a flag that loads the control. This changes the approach from "remove this if" to "include this when." Then, in your calling pages, you'll need to set that flag. To make this new change less invasive, set the default the true and in this page set it to false.