Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 August 28th, 2014, 01:11 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 "Theme Dark Grey cannot be found"

Hello!

I am on the "try it out" on page 231 and am having an issue;
I have added both the Monochrome and the Dark Grey themes to the site. I tried both themes out in the web.config page (<pages theme="DarkGrey" styleSheetTheme="DarkGrey"></pages>) switching back and forth and they both work perfectly. I have added the drop down and the page reloads but doesnt change the theme just as it is supposed to.

Now I have gotten onto "Applying the User-Selected Theme" on page 231 where I code the base page, and now since adding the code to the base page;
Private Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.PreInit
Dim preferredTheme As HttpCookie = Request.Cookies.Get("PreferredTheme")
If preferredTheme IsNot Nothing Then
Page.Theme = preferredTheme.Value
End If
End Sub

I keep getting a runtime error ;


Server Error in '/BegASPNET' Application.
Theme 'Dark Grey' cannot be found in the application or global theme directories.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Theme 'Dark Grey' cannot be found in the application or global theme directories.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Theme 'Dark Grey' cannot be found in the application or global theme directories.]
System.Web.Compilation.ThemeDirectoryCompiler.GetT hemeBuildResultType(String themeName) +853
System.Web.Compilation.ThemeDirectoryCompiler.GetT hemeBuildResultType(HttpContext context, String themeName) +67
System.Web.UI.Page.InitializeThemes() +9529802
System.Web.UI.Page.PerformPreInit() +38
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335



Yet when I remove that new section of code from the Base Page, it works fine again. What am I doing wrong? I don't get any errors in the error list and I was thinking it was because I spelled it "Dark Grey" instead of "DarkGrey" but that doesnt appear to be the issue anywhere I can see either. Any advice?


Thank you!
Reply With Quote
  #2 (permalink)  
Old August 28th, 2014, 05:32 PM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Try clearing your browser's cookies. Looks like you have an old cookie from when the vale of the DropDownOption was called Dark Grey with a space.

Hope this helps; if not please post all the relevant code and I'll take a look.

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
".axd file not found" stops functionality of PostBackUrl Mahesha999 BOOK: Professional IIS 7 and ASP.NET Integrated Programming ISBN 978-0-470-15253-9 0 July 5th, 2011 02:55 PM
Theme switching won't "stick" ksnortum BOOK: Beginning ASP.NET 4 : in C# and VB 5 December 6th, 2010 06:52 PM
Chapter 13 pictureDetails.aspx "The resource cannot be found" Rudy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 24th, 2009 04:39 AM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM



All times are GMT -4. The time now is 06:13 PM.


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