Removing the theme from one ASP.NET page in a project
Asked Answered
O

2

6

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?

Otherdirected answered 20/9, 2010 at 21:3 Comment(0)
O
6

I figured it out I needed StylesheetTheme="" not Theme=""

Otherdirected answered 20/9, 2010 at 21:12 Comment(1)
I needed to use Theme, but this answer led me to the right place. It seems like one of the two will workFossette
H
2

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 = "";
}
Huldahuldah answered 27/5, 2014 at 11:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.