 |
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
|
|
|
|
|

January 16th, 2012, 11:16 AM
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

January 16th, 2012, 01:22 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

January 16th, 2012, 01:46 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
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
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
|
|

January 16th, 2012, 01:51 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

January 16th, 2012, 02:34 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
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.
|
|

January 16th, 2012, 04:55 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

February 11th, 2012, 02:25 PM
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

February 11th, 2012, 04:25 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |
|