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 December 13th, 2008, 10:26 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default Pages 75 & 78

Hi Imar:

I'm really enjoying your book and learning a lot! I'm on chapter 3, page 78. You really do a good job of explaining it all.

On page 75 & 78, unless I'm doing something wrong, if you type the code the way written in the book, you don't get the display shown on page 79.

I changed my code to put the <div id="Sidebar">Sidebar Goes Here</div> right below the Menuwrapper as so:

<div id="MenuWrapper">Menu Goes Here</div>
* <div id="Sidebar">Sidebar Goes Here</div> *

The book has it right above the footer as so:

<div id="Sidebar">Sidebar Goes Here</div>
<div id="Footer">Footer Goes Here</div>

Also, under the styles page, I changed

#Sidebar
{
background-color: Gray;
width: 200px;
float: right;
}
to float right, not left, as it states in the book.

When I made those changes, my display looked like pg. 79.

Before I made those changes, my sidebar appeared at bottom above the footer and on the left side of the page.

Rachel
 
Old December 14th, 2008, 07:49 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 Rachel,

Glad to hear you like the book so much.

What you're describing isn't how it's supposed to be. I just followed the steps in the book again and I do get the output shown in Figure 3-5. My guess is that somehow your HTML isn't correct. Maybe you didn't close the MainContent div and instead put the SideBar div inside the MainContent div instead of just below it? That is, maybe you have this:

HTML Code:
<div id="MainContent">
  ...
  <div id="Sidebar">Sidebar Goes Here</div>
  ...
</div>
instead of:

HTML Code:
<div id="MainContent">
  ...
</div>
<div id="Sidebar">Sidebar Goes Here</div>
I attached a sample file (rename .txt to .aspx and then drag the file into your project) that shows the relevant div elements and the CSS from page 77 and 78 (with embedded styles). This page ends up correct in Design View.

Hope this helps,

Imar
Attached Files
File Type: txt Page78.txt (1.5 KB, 13 views)
__________________
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!

Last edited by Imar; December 14th, 2008 at 07:54 AM..
 
Old December 14th, 2008, 04:15 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Hi Imar:

I went to open my "BegAspNet" solution to look at this and compare with yours but there was no solution! The only thing in that folder are the files I had in my project which I now have to open separately.

I'm just wondering why this would happen? ( had downloaded your chapter 3 when I was trying to see why my display wasn't the same) Is there a way to turn these files into a solution or do I have to create a new website and then add these files?

Also, how do you save copies of a project under a different name so you can keep an original before changes? I had a project which I copied to another folder to have an original copy. But after I ran that project from the other folder location, the changes I made to location 1 were also made to location 2. Do you have to rename it to keep it from being changed? I didn't see where you could "Save solution AS", and create a new name from the file menu as you could do under VB 6.

Rachel
 
Old December 14th, 2008, 04:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There is no solution file; all you need to do is start VWD, choose File | Open Website and then browse for the folder that contains the files. Make sure you open one of the Chapters folders, not the parent....

Not sure what went wrong with your copy. Normally, you should be able to simply copy a Windows folder as a backup. I find it strange that two files at two different physical Windows locations are modified by the same action in VWD. Are you sure that's what happened?

And did you resolve the HTML / CSS issue?

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 December 14th, 2008, 05:27 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
There is no solution file; all you need to do is start VWD, choose File | Open Website and then browse for the folder that contains the files. Make sure you open one of the Chapters folders, not the parent....


Imar
Hi Imar,

I'm talking about my solution. I created a new website called BegAspNet in the folder as the book instructs. It was a solution file. I had all the different pages in the solution explorer. Now when I try to open that file location, my solution is gone but all the files are there. This happened after I downloaded chapter 3 and opened the Default.aspx file.

On the other project i had, I had done a walkthrough from Visual studio's dynamic help on creating log ins. I named it membership and saved it in a specific location. I copied the entire file and put it in another location because I wanted to keep the original I made and then add some changes on the *copy* only. But later, when I opened the original, it had all the changes that I had made on the other copy.

I haven't checked that code yet but I will let you know.

thanks,

Rachel
 
Old December 14th, 2008, 06:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I'm talking about my solution. I created a new website called BegAspNet in the folder as the book instructs. It was a solution file.
Like I said earlier, PlanetWrox is a Web Site Project. The solution file is just there so you can simply open an existing project in VWD. If you want to open the web site again if you don't see the Solution in VWD, simply choose File | Open Web Site. This should work for your own projects (if they are Web Site Projects, not Web Application Projects) and for the PlanetWrox site (as it is a Web Site Project)
Quote:
I copied the entire file and put it in another location because I wanted to keep the original I made and then add some changes on the *copy* only.
What file are you talking about? Is this a .sln file? Or a csproj or vbproj file?

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 December 14th, 2008, 06:35 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi Rachel,

Glad to hear you like the book so much.

What you're describing isn't how it's supposed to be. I just followed the steps in the book again and I do get the output shown in Figure 3-5. My guess is that somehow your HTML isn't correct. Maybe you didn't close the MainContent div and instead put the SideBar div inside the MainContent div instead of just below it? That is, maybe you have this:

HTML Code:
<div id="MainContent">
  ...
  <div id="Sidebar">Sidebar Goes Here</div>
  ...
</div>
instead of:

HTML Code:
<div id="MainContent">
  ...
</div>
<div id="Sidebar">Sidebar Goes Here</div>
Imar
Hi Imar:

I think the html is right but I have pasted what I have below:

THIS IS WHAT I HAVE IN MY STYLES FOLDER/PAGE:

#Header
{
background-color: #C0C0C0;
width: 844px;
height: 83px;
}

*
{
font-family : Arial;
}
h1
{
font-size : 20px;
}
#PageWrapper
{
width: 844px;
}
#Menuwrapper
{
width: 844px;
}
#Maincontent
{
width: 644px;
float: left;
}
#Sidebar
{
background-color: Gray;
width: 200px;
float: right;
}
#Footer
{
background-color: #C0C0C0;
width: 844px;
clear: both;
}

THIS IS WHAT I HAVE IN MY DEFAULT PAGE:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>Untitled Page</title>
<link href="Styles/Styles.css" rel="stylesheet" type="text/css" />

</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="Sidebar">Sidebar Goes Here</div>
<div id="MainContent">
<h1>
Hi there visitor and welcome to Planet Wrox</h1>

We're glad you're paying a visit to
<a href="http://www.PlanetWrox.com">www.PlanetWrox.com</a>, the coolest music
community site on the net.

<p>
Feel free to have a look around; as there are lots of interesting <b>reviews and
concert pictures</b> to be found here.
</p>

</div>

<div id="Footer">Footer Goes Here</div>
</div>
</form>

</body>
</html>

If I move the sidebar down to right above the Footer code then it displays right above the footer instead of under the menu area near top. I also had to change that left to right to make it appear on right.

I must have missed something somewhere but I just can't find it.

Rachel
 
Old December 14th, 2008, 06:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're using #Menuwrapper with a lower case w. The HTML ID is with an upper case letter. Same goes for Maincontent versus MainContent.

Remember: CSS is case sensitive, so this really matters. With an ID of MainContent, the CSS selecter Maincontent is never used.

Once I renamed the styles, changed right to left and moved the SideBar div down again, evetyhing worked.

BTW: no need to quote an entire message as the entire thead is always visible here. Quotes are typically used to quote short lines only....

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!
The Following User Says Thank You to Imar For This Useful Post:
Rachel (December 15th, 2008)
 
Old December 14th, 2008, 07:03 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Ahh! Thanks!

Rachel
 
Old December 15th, 2008, 12:30 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Hi Imar:

I know this works but I'm trying to understand why. I hope you don't mind my inquisitiveness.

You say on page 79 that having the #MainContent float "left", tells the MainContent to float on the left side of the sidebar, effectively placing the sidebar to the right of it. And the two add up the the total width of the page setting. I understand up to that point. What I don't understand is the float setting for SideBar. What (if anything) is it causing to float ? I set it to float "right" just out of curiosity and the page display didn't change. Maybe that matters once you start filling in the sidebar?

Rae





Similar Threads
Thread Thread Starter Forum Replies Last Post
save images in size .75 X .75 infotech VB How-To 2 May 11th, 2007 05:54 PM
Chapter 2 Pg. 75-77 while function joshkosmala BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 28th, 2007 04:27 PM
iFrames & ASPX Pages bandrsolutions ASP.NET 2.0 Basics 0 October 18th, 2006 04:15 AM
Debug example seemingly not quite right on page 78 kowalke BOOK: Beginning Mac OS X Programming 5 August 17th, 2006 02:04 PM
downloads for VB Oracle 8 1-861001-78-9 johnfreed0 All Other Wrox Books 6 September 23rd, 2004 07:22 PM





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