Programmatic Themes
If anybody has figured out how to switch themes when selecting from a DropDownList please post the branching logic code and explain which page processing methodology was used, i.e. Page_Load or Page-PreInit.
I'm having a problem changing themes when attempting to select a theme from a DropDownList and hope somebody can suggest what is wrong with the branching logic which seems to be the problem
The .aspx includes EnableTheming="true" in the page directive.
The DDL AutoPostBack="true" and is briefly declared as follows:
value="SelectStyleSheet" selected="True">
Select A Style Sheet
value="red">
Red Theme
value="green">
Green Theme
value="blue">
Blue Theme
The red theme should be loaded by default.
The following code does not change style sheets when a selection is made from the DDL and I'd like to learn what code should be used so the list item will continue to show 'Select A Style Sheet' after each selection...
void Page_PreInit(object sender, System.EventArgs e) {
if (ChangeStyleSheet.SelectedValue == "SelectStyleSheet")
Page.Theme = "red";
else
Page.Theme = ChangeStyleSheet.SelectedValue.ToString();
}
|