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="" %>