Disable Theming and StyleSheet theme for one specific page in Asp.Net 2.0
I recently started using the new Theming features of asp.net 2.0 and I have to say it works like a charm !
Just putting one line inside the Web.Config file to enable a theme and change the look of the complete website is just fabulous...
But what to do when you want to disable everything for one page ? I searched the internet for a solution but found none ( maybe I didn't look very good ?
) !
I know there are 2 page directives that help setting the themes, but to disable them I only found one !
<%@ Page Language="C#" Theme="OrangeTheme" StyleSheetTheme="GreenTheme" %>
<%@ Page Language="C#" EnableTheming="false" %>
But the EnableTheming will only effect the choosen theme and will not effect the StyleSheet theme !!
Even our friend the intellisence didn't offer me any clues... When you type Theme=", it will show you a list of available themes, so you can choose one from it.
So I was stuck and needed this feature for the default.aspx page of a small website I was building. But like many other solutions, this one also came by accident !
When I was trying every combination of theme and stylesheet, I just ( for the fun of it ) entered 2 empty string sequences, to see what the result would be... And tadaaaaa, what did I get, a default.aspx page 'without a theme and stylesheet theme' !!!
So people when you want NO theme and NO stylesheet theme just use following code :
<%@ Page Language="C#" Theme="" StyleSheetTheme="" %>




March 28th, 2007 - 17:47
Thanks for this its been “wrecking my buzz” for a week.
May 7th, 2007 - 10:55
Thanks a million!
January 13th, 2008 - 22:20
Oh my god……………………..
WILL YOU MARRY ME?!?!?!?
Damnit ASP.NET Themes!! They are truly a pain in the *ss!!
It’s been a long fight, dont try to show an excel file or xml with themes activated inside web.config, they just ask for head=”server”, and since you only have the header inside the aspx page () it doesnt work.
But now, it WORKS!!!!!!!!!!!
Thank you a MILION! I owe you a beer at least!
March 3rd, 2008 - 11:59
I tried this and it works fine too.
June 9th, 2008 - 13:00
Thanks man for this
I was trying to get rid of the stupid theme from a specified web page and I couldn’t find the way to do it.
Thanks a million
September 12th, 2008 - 22:19
excellent…u saved my time..
September 13th, 2008 - 09:20
Thanks for the comments !
Great that I could help out
September 16th, 2008 - 08:39
Wow man thanks for the help
November 4th, 2008 - 02:10
Thank you so much for this post. It would have taken me forever to stumble onto that.
December 11th, 2008 - 01:23
thanks alot
August 19th, 2009 - 21:24
Excellent. Just what the doctor ordered!!!
July 7th, 2010 - 19:11
Saved the day, thank you so much. Best regards from Brasil.