Change or remove dot net themes from a page

Setting a theme in web.config is to set it globally. I found that Its better to set it in Master page with the code:

protected void Page_PreInit( object sender, EventArgs e)
{
this .Page.Theme = “ThemeName”;
}

But in the case that we have set it globally in web.config file with StyleSheetTheme attribute.
Global theme can be overridden by the following code;

public override string StyleSheetTheme
{
get { return ThemeName ; }
}

and to remove a theme from a page even if the page header is not set to runat=”server” we can set it to null as below;

public override string StyleSheetTheme
{
get { return null ; }
}

Advertisements

~ by UTS on April 10, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: