Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2012, 11:16 AM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Location: Michigan, USA
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.
Reply With Quote
  #2 (permalink)  
Old January 16th, 2012, 01:22 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
Old January 16th, 2012, 01:46 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Location: Michigan, USA
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
Reply With Quote
  #4 (permalink)  
Old January 16th, 2012, 01:51 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #5 (permalink)  
Old January 16th, 2012, 02:34 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Location: Michigan, USA
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.
Reply With Quote
  #6 (permalink)  
Old January 16th, 2012, 04:55 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #7 (permalink)  
Old February 11th, 2012, 02:25 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #8 (permalink)  
Old February 11th, 2012, 04:25 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:28 PM.


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