CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » CodeDigest » Disabling Theme Set in Web.Config in a Page   You are not logged in.
Search
 

Sponsors
InstallShield
 

Sponsored Links
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Disabling Theme Set in Web.Config in a Page
Disabling Theme Set in Web.Config in a Page
Submitted By Satheesh Babu
On 6/8/2009 8:48:45 AM
Tags: asp.net,CodeDigest  

Disabling Theme Set in Web.Config in a Page

We use themes and skins to provide consistent look and feel for our application. To apply a theme to whole application we can set it in web.config file [inside System.Web].

<pages theme ="CDTheme1" />

 

At times, we will have situations to prevent a page from applying the theme we have set in web.config.

This can be achieved by overriding Themes setting in that particular page. Page directive will have a Theme attribute which can be set to "" to prevent the page from applying the theme.

 

<%@ Page Language="C#" AutoEventWireup="true" Theme="" CodeFile="FullImage.aspx.cs" Inherits="FullImage" %>

If it is a StyleSheetTheme, set StyleSheetTheme =""

Another way of doing this is by overriding these attributes in codebehind.

For Theme,
protected void Page_PreInit(object sender, EventArgs e)
{
this.Theme = string.Empty;
}


For StyleSheetTheme,
public override String StyleSheetTheme
{
get { return string.Empty; }
}

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!