Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Beta Preview
This is the forum to discuss the Wrox book ASP.NET 2.0 Beta Preview by Bill Evjen; ISBN: 9780764572869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Beta Preview section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2004, 01:31 PM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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();
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatic manipulation of a datagridview vbprowanabe Pro Visual Basic 2005 2 January 3rd, 2008 09:16 PM
Programmatic Validation rit01 ASP.NET 2.0 Professional 3 May 11th, 2006 01:23 AM
Programmatic Rendering drhabi BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 27th, 2004 06:00 PM
Programmatic Rendering - Chapter 9 booksnore2 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 7th, 2004 07:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.