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 April 13th, 2010, 02:41 AM
Registered User
 
Join Date: Apr 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6: Sidebar Goes Here

In chapter 6 the Sidebar is on the left side and not the right. I tried to change the CSS Code to right instead of left and not change. Here is the code that I have below.

<form id="form1" runat="server">
<div id="PageWrapper">
<div id="Header"><a class="HeaderLink" href="~/" runat="server">Header Goes here</a></div>
<div id="MenuWrapper">Menu Goes Here</div>
<div id="MainContent">
<asp:ContentPlaceHolder ID="cpMainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="SideBar">Sidebar Goes Here</div>
<div id="Footer">Footer Goes Here</div>
</div>
</form>

CSS Code Below:

#Sidebar
{
background-color: #808080;
width: 200px;
float: right;
}
 
Old April 13th, 2010, 02:48 AM
Registered User
 
Join Date: Apr 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default I found my errors:

My CSS code shows Sidebar and I typed into the MasterPage SideBar. Lastly, in the book the CSS code has float: left so I changed it to float: right and now it matches what the image shows in the book.
 
Old April 13th, 2010, 03:31 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 the source for chapter 6 that comes with the book as a download. In Monochrome.css you find this:
Code:
 
 
#MainContent
{
  font-size: 0.8em;
  width: 659px;
  border-left: 1px solid white;
  border-right: 2px solid white;
  float: left;
  background-color: #e1e1e1;
  min-height: 500px;
  padding: 10px;
}
 
#Sidebar
{
  font-size: 0.8em;
  background-image: url(Images/Sidebar.jpg);
  background-repeat: no-repeat;
  background-color: #cccccc;
  width: 152px;
  min-height: 500px;
  padding-top: 10px;
  padding-left: 10px;
  float: left;
}
Both have a float left which causes them to end up side by side. This works if the id attributes of the MainContent and Sidebar (including capitalization) match the CSS selectors.

Hope this helps,

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you position the Sidebar at absolute top-right? saidrad BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 11 April 12th, 2009 07:42 AM
Unanswered posts link on sidebar bmains Forum and Wrox.com Feedback 6 December 20th, 2008 06:16 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM
Header and Sidebar of MasterPage not shown KamalRaturi ASP.NET 2.0 Professional 0 August 27th, 2006 04:45 PM
Sidebar loading through reflection? bmains C# 2005 0 October 20th, 2005 10:21 PM





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