一个网站,多个主题,发布后更改主题

1. App_Code/Config.cs

public static string ThemePath
    
{
        
get
        
{
            
string themeName = ((PagesSection)WebConfigurationManager.GetSection("system.web/pages")).Theme;
            
return themeName;
        }

    }
2. default.aspx
 protected void Page_PreInit(object sender, EventArgs e)
    
{
        Page.Theme 
= Config.ThemePath;
    }
3.web.config
<pages theme ="B"></pages>

页面可以给一个css,方便开发用,没有实际用途,web.confgi给一个默认主题,发布后可以更改主题,页面主题来自于此设置,实现于第2步
posted @ 2006-12-02 17:44  chy710  阅读(141)  评论(0)    收藏  举报