Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 January 16th, 2012, 11:16 AM
Registered User
 
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 - Themes

Page 222, steps 7 and 8. Adding styleSheetTheme="Monochrome" to the <pages> element of my web.config file does not affect the display in design view. If I display the page in my web browser and check the source, I see two occurrences of the <link> element, so I believe the web.config file is correct. Not sure why design view isn't reflecting the style changes.

Jim

Last edited by jmartin; January 16th, 2012 at 11:25 AM.. Reason: Removed 2nd problem from post.
 
Old January 16th, 2012, 01:22 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you try removing the theme attribute (and only leave styleSheetTheme) from the pages element?

With regards to your second problem, I guess you found the code you needed to add to BasePage to set the selected theme? ;-)

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 16th, 2012, 01:46 PM
Registered User
 
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Did you try removing the theme attribute (and only leave styleSheetTheme) from the pages element?
I just tried that with no change. I'm running an evaluation copy of Visual Studio 2010 Ultimate on an XP SP3 machine. Don't know if that has anything to do with it.

Quote:
Originally Posted by Imar View Post
With regards to your second problem, I guess you found the code you needed to add to BasePage to set the selected theme? ;-)

Imar
Yeah - I didn't realize the Try It Now was just for the drop down list selection. I thought it was going to apply the new theme also. After looking at the code a little harder I realized there was nothing actually setting the theme, then saw that it was in the next Try It Now. You live, you learn.

Jim
 
Old January 16th, 2012, 01:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I'm running an evaluation copy of Visual Studio 2010 Ultimate on an XP SP3 machine. Don't know if that has anything to do with it.
No, it shouldn't. All versions of VS / VWD on all versions of Windows should work the same here.

Does the theme work at run-time? And does it work when you try it woth my code that comes with the book?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 16th, 2012, 02:34 PM
Registered User
 
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Does the theme work at run-time? And does it work when you try it woth my code that comes with the book?

Imar
It works at run-time ok. I just opened up the Chapter 6 code from the book, changed the web.config from Theme to styleSheetTheme, and tried it. Works fine. Went back to my project and it's working fine there now too. I'm not sure what the problem was.

Jim

P.S. - I really appreciate your quick responses to my posts.
 
Old January 16th, 2012, 04:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Jim,
Quote:
Went back to my project and it's working fine there now too. I'm not sure what the problem was.
VS sometimes has issues applying this setting. Closing and opening documents, the entire solution / site or even Visual Studio usually solves the issue. Looks like that's what happened here.

Quote:
P.S. - I really appreciate your quick responses to my posts.
You're welcome....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 11th, 2012, 02:25 PM
Registered User
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem. The following line of code needs to be changed in frontend.master to reference the correct method in frontend.master.cs:

onselectedindexchanged="ThemeList_SelectedIndexCha nged1">

should be changed to:

onselectedindexchanged="ThemeList_SelectedIndexCha nged">

Somehow two methods got created when adding the ThemeList dropdown.
 
Old February 11th, 2012, 04:25 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

This is not by design / hope it's supposed to work. This can happen if you set up a handler by double-clicking, save the changes in the .cs file, but then undo or discard the changes in the aspx file. Then you already have an existing handler in the code behind so the next time you double-click the control Visual Studio creates a new method with a sequential number.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 6 themes ajayreddy28390 BOOK: Beginning ASP.NET 4 : in C# and VB 1 December 19th, 2011 08:13 AM
Themes in Chapter 6 once more dhess BOOK: Beginning ASP.NET 4 : in C# and VB 2 June 18th, 2011 07:46 AM
Chapter 6 Themes flapjack BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 May 1st, 2010 09:39 AM
Chapter 6 dynamically swithing Themes? yantaq BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 9 January 27th, 2009 06:28 PM
Chapter 5 Applying themes to Page Try it Out mcauliff BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 3rd, 2007 11:04 AM





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