p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   Cant Find Dark Green (http://p2p.wrox.com/showthread.php?t=85640)

Derrick T. Davidson November 9th, 2011 10:38 PM

Cant Find Dark Green
 
Hi I am a newbie please bear with me,

I have succesfully done all the exercises in the book until the end of chapter six. Now I try to load the pade and I get the error below. I have copied the code from the sample chapters to my application but the same message keeps showing.

What am I doing wrong?

Server Error in '/Site' 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) +934
System.Web.Compilation.ThemeDirectoryCompiler.GetT hemeBuildResultType(HttpContext context, String themeName) +73
System.Web.UI.Page.InitializeThemes() +9003430
System.Web.UI.Page.PerformPreInit() +38
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

morteza November 9th, 2011 11:12 PM

Hi Derrick,
The error message said you have not Theme's by "Dark Gray" name. As i know the correct name is 'DarkGray'(whitout space) in resource in the book. Please look at Theme folder and and look for right name of theme.
I hope this help you.

Derrick T. Davidson November 9th, 2011 11:56 PM

Cant Find Dark Grey
 
Thanks Morteza

My Solution Explorer shows:
App_Themes
Folder> DarkGrey
Folder> Images
SubFolder> Header.jpg
File> DarkGrey.css
The same folders and files for Monochrome are also shown similar to this in the App_Themes folder.

Please note "Grey" is shown not "Gray" and I am using Visual Studio Ultimate?

morteza November 10th, 2011 12:01 AM

OK you should use 'DarkGrey' in your code instead of 'Dark Grey'(with space).
any doubt please comment.

Derrick T. Davidson November 10th, 2011 12:09 AM

I have no spaces between the name "DarkGrey". Even if I try to run the code from the Chapter six source file downloaded with the book I get the same message?

morteza November 10th, 2011 12:14 AM

Quote:

Exception Details: System.Web.HttpException: Theme 'Dark Grey' cannot be found in the application or global theme directories.
This error said that : you use 'Dark Grey' in your code. Did you use it in :
Code:

switch (Page.Theme.ToLower())
{
case “darkgrey”:
Menu1.Visible = false;
TreeView1.Visible = true;
break;
default:
Menu1.Visible = true;
TreeView1.Visible = false;
break;
}

?

morteza November 10th, 2011 12:16 AM

also in web.config file check this :
Code:

<pages theme=”DarkGrey”>
...
</pages>

Did you enter DarkGrey like the theme name in Theme folder?

Derrick T. Davidson November 10th, 2011 12:24 AM

MasterPage Code:

<asp:DropDownList ID="ThemeList" runat="server" AutoPostBack="True">
<asp:ListItem>Monochrome</asp:ListItem>
<asp:ListItem>DarkGrey</asp:ListItem>

Web Config = <system.web>
<pages theme="Monochrome" styleSheetTheme="Monochrome"/>
The book says this is the default page

I cant see anywhere there is a space???

Derrick T. Davidson November 10th, 2011 12:25 AM

P.S.

Am using Visual Basic not C#

morteza November 10th, 2011 12:32 AM

In 'Edit' menu select 'Find and Replace' sub-menu and then select 'Find in Files'; In Window that appears in 'Find what' field type 'Dark Grey' and for look in : select Entire solution and click Find all.


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

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