Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 April 10th, 2008, 02:27 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I didn't mention this explicitly in the book, as it assumes you set the Theme, not the StyleSheetTheme. There are many choices made early in the book that affect how things behave later, and it's impossible to cover / discuss all possible scenarios and variations ;)

Take a look again at this code:

Select Case Page.Theme.ToLower()

This code switches on the current Theme and shows / hide the relevant controls. When the theme has not been set explicitly, this code fails as there is no theme to switch on.

To programmatically change the styleSheetTheme you need to take a different route. Instead of handling PreInit, you need to override the StyleSheetTheme property at the page level, like this:

Public Overrides Property StyleSheetTheme() As String
   Get
       Return "BlueTheme"
   End Get
   Set(ByVal value As String)
   End Set
End Property

The best location to do this is in the central BasePage class as it'll apply to all pages. Instead of returning a hard coded value of BlueTheme, you need to retrieve the selected theme from the cookie and return that.

For more information: http://msdn2.microsoft.com/en-us/library/tx35bd89(VS.80).aspx

However, I am not 100% sure that styleSheetTheme will continue to work without any side effects. Maybe it's better to stick to Theme now while you learn how it works, and then later switch to another variation?

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old April 10th, 2008, 08:09 AM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess I will look further into it after I finish the book. One thing you may recall, I need the ability to overwrite properties in the css. So I wouldn't be able to use the <page theme="Monochrome"> option. (or themes at all if I understand it right)

Anyway, I'm on chapter 10 and I have a couple problems that I'd like to bring up.

After I add an update panel to the ContactForm.ascx file, I couldn't view anything in the Design mode. Additionally, it shows an error and doesn't recognize the class in the div:

<div class="pleaseWait">
Message being sent, please wait...
</div

(it's .pleaseWait in the css file also)

Although it shows an error, it still does work when I send the email.

Are those two things normal when working with ascx files?

 
Old April 10th, 2008, 08:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, it's not normal, and it shouldn't be like this. Does the code that comes with the book have the same problem?

Can you please start a new thread for a new topic / chapter?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu Navigation behind Control jwiedmier BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 March 19th, 2008 10:54 AM
Easiest/Recommended Navigation Menu Control/Soluti andhuang ASP.NET 2.0 Professional 0 February 7th, 2007 04:13 PM
Chapter 3 Menu Control ybai BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 June 30th, 2006 02:38 AM
How do I get a menu/navigation look like this? R/O LuxeGirl Classic ASP Basics 4 January 22nd, 2005 08:04 PM
pop up menu on navigation bar joshil Dreamweaver (all versions) 0 May 16th, 2004 07:53 AM





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