Wrox Programmer Forums
|
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
 
Old September 22nd, 2012, 01:50 AM
Registered User
 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6

Hi I am currently a newbie in ASP.net and I am using the book version of ASP.NET 3.5 in C# and VB. I am trying to do chapter 6 of the book. I have reached page 228 but I have encountered some problems:

1. When I apply the DarkGrey theme for some reason it doesn't display properly as it should be. The header image does not appear. I have followed the instructions, put the folders where it should be but to no avail. The monochrome theme on the other hand works perfectly.

2. In dynamic switching themes, at first despite following the instructions it doesn't work until I read in the forums to make the default page inherit from the base page that I have created. But it seems that step is not included in the book or am I wrong or maybe I missed some detail instruction.

Note: The textbook given for us is ASP 3.5 but the software we are using is 4.0.

Thanks
 
Old September 22nd, 2012, 03:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

For question 1, can you post the following:

1. The markup for your Master Page
2. The address you see in the address bar (just localhost:123 or localhost:123/Site or something like that)
3. The first 30 lines or so of the HTML for the page in the browser with the DarkGrey theme applied

For question 2: take a look at page 207, step 3 and page 208, step 6. These steps show you how to make your pages inherit this new BasePage.

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!
 
Old September 22nd, 2012, 07:22 AM
Registered User
 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Here is the markup for my master page:

<%@ 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>

</head>
<body>
<form id="form1" runat="server">
<div id="PageWrapper">
<div id="Header">Header Goes Here</div>
<div id="MenuWrapper">Menu Goes Here</div>
<div id="MainContent">
<asp:ContentPlaceHolder ID = "cpMainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="Sidebar"><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>


2. The address I see in the address bar

http://localhost:60277/WebSite7/Default.aspx

Note: I put another image loading code in the CSS of DarkGrey under the first header but its still not the same as what is in the book.

3. Here is the first 30 lines of the source code


<!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><title>
Welcome to Planet Wrox
</title>
<link href="App_Themes/DarkGrey/DarkGrey.css" type="text/css" rel="stylesheet" /></head>
<body>
<form method="post" action="Default.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAgIDD2QWAgIDDxBkZBY BAgFkZHWT4pOftclQ4z3Ia+kPzCeoY76pZEpnipC8aD4HpnkD" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
 
Old September 23rd, 2012, 09:15 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look at this code you posted:

Code:
 
<div id="Header">Header Goes Here</div>
You're missing the HeaderLink which is the element that gets the background image through CSS. Page 197, step 3 shows the correct code you need to add to the Master Page.

Also, check out the errata for the book at http://www.wrox.com/WileyCDA/WroxTit...Cd-ERRATA.html for a fix of a difference between the code and the image shown in the book.

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!
 
Old September 24th, 2012, 08:02 AM
Registered User
 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar. Works like a charm!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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