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