Tuesday, August 4, 2009

Changing theme of whole website at run time

Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~");
System.Web.Configuration.PagesSection appSettingsSection = (System.Web.Configuration.PagesSection)configuration.GetSection("system.web/pages");
if (appSettingsSection != null)
{
appSettingsSection.Theme = "First";
configuration.Save();
Response.Redirect("Default.aspx");
}

No comments:

Post a Comment