ASP.NET Multiple Themes in One Site -


i have app_themes directory, , master pages asp.net website.

can use 2 different themes based on master page?

msdn has article asp.net master pages , themes

you cannot directly apply asp.net theme master page. if add theme attribute @ master directive, page raise error when runs.

however, themes applied master pages under these circumstances:

  • if theme defined in content page. master pages resolved in context of content pages, content page's theme applied master page well.

  • if site whole configured use theme including theme definition in pages element (asp.net settings schema) element.

in addition above can see section themes , skins. can change theme programmatically

example msdn

protected void page_preinit(object sender, eventargs e) {     switch (request.querystring["theme"])     {         case "blue":             page.theme = "bluetheme";             break;         case "pink":             page.theme = "pinktheme";             break;     } } 

but cannot use 2 themes @ same time, not make sense. change theme based on masterpage used.

to answer question in comment, yes can have different themes different sub-folders. msdn:

a theme setting in web.config file applies asp.net web pages in application. theme settings in web.config file follow normal configuration hierarchy conventions. example, apply theme subset of pages, can put pages in folder own web.config file or create element in root web.config file specify folder. details, see configuring specific files , subdirectories.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -