Hi,

I m having a problem in assigning css and themes to my pages in
subfolder.
I have created two different master page for two themes.

SiteMasterPage :
1) SiteMasterPage.master in root folder.
   Uses following :
        1) TreeView control for menus
        2) Themes - Theme1
        3) Css files :
                1) master.css - Common Css
                2) theme1.css - Theme1 Css

2) SiteMasterPage2.master in root folder.
        1) Menu control for menus
        2) Themes - Theme2
        3) Css files :
                1) master.css - Common Css
                2) theme2.css - Theme1 Css

3) Images folder in root directory


Actually want to give user different looking themes with different
menu styles.
I m changing the master pages and themes in the Page_PreInit method as
follows :

protected void Page_PreInit(object sender, EventArgs e)
{
        if (Session["masterpage"] != null)
        {
                //Set the masterpage
                string masterpage = "~/" + Session
["masterpage"].ToString();
                pg.MasterPageFile = masterpage;
                if (pg.MasterPageFile.Contains("SiteMasterPage2"))
                {
                        pg.Theme = "Theme2";
                }
                else
                {
                        pg.Theme = "Theme1";
                }
        }
        else
        {
                //Set the default masterpage
                 string masterpage = "~/SiteMasterPage.master";
                 pg.MasterPageFile = masterpage;
                 pg.Theme = "Theme1";
        }
}

My SiteMaster is in the root folder. Pages in the root directory work
fine, but the pages in subfolder don't get the css and theme files.
Does anybody have a solution

for this. Please help me on this problem.


Thanks,

Niraj D. Phalke



Reply via email to