 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
|
|
|
|
|

September 16th, 2011, 10:24 AM
|
|
Authorized User
|
|
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Switching Themes
After having gone through the Book to about Ch 10 I now discover trouble in switching Themes.
The default page comes up in darkGrey while showing Monochrome in the DD List (lstPreferredTheme) .When making the other choice the page still remains in DarkGrey.
All code appears to be correct.
Has anyone any idea of a solution?
|
|

September 16th, 2011, 10:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Did you remove the styleSheetTheme from the web.config file?
Imar
|
|

September 16th, 2011, 12:26 PM
|
|
Authorized User
|
|
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Switching Themes
Hi Imar,
Yes - that code is removed.
web.config code is
Code:
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
</compilation>
<pages theme="Monochrome">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
Allan
|
|

September 16th, 2011, 12:57 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
In that case, can you post the full code for the master page (code behind and markup), the ASPX page you're testing this on (code behind and markup) and the BasePage from the App_Code folder?
Cheers,
Imar
|
|

September 16th, 2011, 02:50 PM
|
|
Authorized User
|
|
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Switching Themes
Imar,
Thank you for quick reply.
In the meantime I 've played around with the code in an effort to solve the problem.
Never the less, here is the code. The Inherits appears wrong so I want to follow this before I return with the remaining code.
Code:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPages_MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<link href="../Styles/Styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="PageWrapper">
<div id="Header"><a id="A1" class="HeaderLink" href="~/" runat="server"></a></div>
<div id="MenuWrapper">Menu Goes Here</div>
<div id="MainContent">
<asp:ContentPlaceHolder ID="cpMainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="Sidebar">
Select a Theme <asp:DropDownList ID="lstPreferredTheme" runat="server"
AutoPostBack="True">
<asp:ListItem>Monochrome</asp:ListItem>
<asp:ListItem>DarkGrey</asp:ListItem>
</asp:DropDownList>
</div>
<div id="Footer">Footer Goes Here</div>
</div>
</form>
</body>
</html>
cheers
Allan
|
|

September 16th, 2011, 02:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Are you following the book with Visual Studio / VWD 2010? The inherits statement looks fine (folder name + file name) but you can only tell if it's really valid by looking at the code behind.
Cheers,
Imar
|
|

September 16th, 2011, 03:44 PM
|
|
Authorized User
|
|
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Switching Themes
Imar,
I think I've got it
i use VWD 2008 Exp with IE 8 +vista
Earilier I tried this on XP where the master vb code behind appeared as Partial Class MasterPage, against Vista giving
Code:
Partial Class MasterPages_MasterPage
However besides that I ended up with a 2nd MasterPage.master in the root of the Site!! Don't know why.
Thanks for your excellent book and help.
Cheers,
Allan
|
|

September 16th, 2011, 04:11 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I don't think it's a Vista versus XP issue. It could be that the behavior has changed in VS 2008 SP1. When I add a new master page to a subfolder it sets the Inherits attribute to FolderName_MasterPage name. I don't have an installation of VS 2008 without a Service Pack here so I can't check the behavior, and I don't recall how it was before SP1.
It could also be that you initially created the master in the root and then moved the file to a subfolder. That wouldn't change the Inherits attribute.
But are the problems fixed now? Do you see the correct theme appear?
Imar
|
|

September 18th, 2011, 09:52 AM
|
|
Authorized User
|
|
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Switching Themes
Imar,
Yes thank you, everything seems to be working correctly now.
I think it must have been due to duplicate master pages in the Site.
One thing I did notice on re-starting is that banner .ascx shows in Design view while ContactForm does not? Is this normal.
Cheers
Allan
|
|
 |