We have a page that creates a printable version of the customer's bill. We are using themes via <pages styleSheetTheme="CityDesign">
. This page is not using the Master page nor has any style sheet associated with it. I have added <%@ Page Language="C#" EnableTheming="false" Theme="" %>
to the page and protected void Page_PreInit(object sender, EventArgs e) { Page.Theme = String.Empty;}
to the code behind. The page still has the theme applied. What am I doing wrong?
Answer: To remove themes from your page, use the EnableTheming attribute of the Page directive.
ASP.NET themes are a collection of properties that define the appearance of pages and controls in your Web site. A theme can include skin files, which define property settings for ASP.NET Web server controls, and can also include cascading style sheet files (. css files) and graphics.
I figured it out I needed StylesheetTheme=""
not Theme=""
The accepted answer didn't work for me. I couldn't get anything to work in the markup, but this solution does work in the code-behind file (aspx.cs for example).
Just add this method to your code-behind file:
protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "";
}
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