Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 26th, 2010, 01:57 AM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 40
Thanks: 4
Thanked 0 Times in 0 Posts
Default Help on chapter 6 needed

Hi Imar. Im going through your back for the second time carefully and trying to build my own very similar site using the book carefully. Im currently on chapter 7. Ive used my own menu options: 'Home', 'Search','Add an advert','About Us' and 'Login' instead of 'Home', 'reviews', 'gig pics', 'about us' and 'login'. However across my menu these words seem to be spaced fairly close together and do not take up the full bar as the planet wrox site does I have made in which Home is aligned as far left on the menu as you can go and Login on the futherst right.

I do not seem to be able to locate on the book where it explains how to spread my menu items out and at present my 'login' is not fully to the right meaning the menu options appear fairly closed together and crushed up.

Can you point me towards where it explains in the book how to get the menu options to spread ocross the full menubackground.jpeg menu?

Thanks.

Lee
Reply With Quote
  #2 (permalink)  
Old August 26th, 2010, 05:29 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,955
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Hi there,

It looks like you're using the ASP.NET 3.5 version of the book with Visual Studio 2010, is that correct? If so, check out this post for an explanation and some work arounds: IE8 and the Menu

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!
Reply With Quote
  #3 (permalink)  
Old August 31st, 2010, 09:32 PM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 40
Thanks: 4
Thanked 0 Times in 0 Posts
Default

No im using Visual Studio 2008 Imar. Ive followed the book carefully and not sure why they are spaced this way. How can i spread them out fully across the menu bar?
Reply With Quote
  #4 (permalink)  
Old September 1st, 2010, 03:06 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,955
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

In that case, can you post the code for the Master Page and the relevant CSS?

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!
Reply With Quote
  #5 (permalink)  
Old September 1st, 2010, 03:59 AM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 40
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Heres my code Imar. This is my second go at the book but im playing around and changing the odd thing to get a better understanding such as i have different menu headings as you will see. The majority of the code is exactly the same as the book so im unsure why in the bool-Home,Reviews, About and Login are perfectly spaced apart but my headings are clumped together and i just cant figure it out. Help would be appreciated. Thanks Imar.

Masterpage
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="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>Master Page</title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
   
</head>

<body>
    <form id="form1" runat="server">
    <div id="PageWrapper">
    <div id="Header"><a class="HeaderLink" href="~/" runat="server"></a></div>
    <div id="MenuWrapper">
    <asp:menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" 
            Orientation="Horizontal" StaticEnableDefaultPopOutImage="False">
            <StaticMenuItemStyle CssClass="StaticMenuItemStyle" />
            <StaticSelectedStyle CssClass="StaticSelectedStyle" />
          <DynamicHoverStyle CssClass="DynamicHoverStyle" />
          <DynamicMenuItemStyle CssClass="DynamicMenuItemStyle" />
          <StaticHoverStyle CssClass="StaticHoverStyle" />
        </asp:menu>
        
        <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" 
            ShowExpandCollapse="False" Visible="False">
        </asp:TreeView>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" 
            ShowStartingNode="False" />
    </div>
     
    <div id="MainContent">
       <asp:SiteMapPath ID="SiteMapPath1" runat="server">
        </asp:SiteMapPath><br /><br />
    
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
    </asp:ContentPlaceHolder>
    </div>
    <div id="Sidebar" align="center">
    <br />
    <br />
    
   
    
        <SSB:Banner ID="Banner1" runat="server" />
    
   
    
   </div>

   
    
    <div id="Footer"></div>
    </div>
    </form>
</body>
</html>
Default page
Code:
<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="HomePage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            font-size: x-large;
            font-weight: bold;
        }
        .style2
        {
            font-size: x-large;
            font-weight: normal;
        }
        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            font-size: medium;
            font-weight: normal;
        }
        .style5
        {
            font-size: medium;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="MainContent0">
        <h1>
            <span class="style3">Hi and Welcome to Salford Student Books</span><span class="style1"><b><br />
            </b>
        </h1>
        </span>
        <p>
            <span class="style4">Salford Student Books is </span>
            <span class="style2"> <a href="http://www.salford.ac.uk" class="style5">
            The University of Salford's</a></span><span class="style4"> exclusive home for buying and selling your 
            student books. Here you'll find a large range of student books in every 
            category. You can </span>
            <span class="style2"> <b class="style5">search for books</b><span 
                class="style4"> or </span>
            <b class="style5">add a book</b><span class="style4"> to sell here. </span>
            <b class="style5">
            Registration</b><span class="style4"> is absolutely free. </span>
            </span>
        </p>
        <p>
            <a href="Log-in.aspx" class="style5">Log In Here</a></p>
    </div>
</asp:Content>
Reply With Quote
  #6 (permalink)  
Old September 1st, 2010, 04:00 AM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 40
Thanks: 4
Thanked 0 Times in 0 Posts
Default

ooh i forgot the css style sheet.

Code:
*
{
    font-family: 'Times New Roman' , Times, serif;
    font-size: 13px;
    }

body
{
    /* 
		Clears white space around the body except for the top which gets 10 pixels.
	*/
    margin: 10px 0 0 0;
    font-size: 14px;
}

a
{
    /*
		Clears the underline on normal links, and give them #308462 as the color.
	*/
    color: #0000FF;
    text-decoration: none;
}

a:hover
{
	/*
		Underlines links when the users hover the mouse over them.
	*/
	text-decoration: underline;
}

h1
{
    /*
    Makes h1 elements smaller than their browser default.
  */
    font-size: 22px;
    font-weight: bold;
}

.Introduction
{
    font-style: normal;
    color: #000000;
    font-size: 16px;
}

#PageWrapper
{
    /*
		Sets the total width for the entire page. 
	*/
    width: 844px;
    background-color: #003300;
}

#Header
{
    /*
		Gives the header the same width as the PageWrapper. The height creates some room for the logo
		that is set with the background-image.
	*/
    background-image: url(Images/Header.jpg);
    width: 844px;
    height: 86px;
}

.HeaderLink
{
	/*
		The #HeaderLink is nested in the #Header. It provides a link to the homepage.
	*/
	width: 844px; 
	height: 86px; 
	display: block;	
}

#MenuWrapper
{
    /*
		The menu spans the page width, right below the header.
		At the top and left a few pixels padding is applied to create some room.
	*/
    background-image: url('Images/BackGroundMenu.jpg');
    width: 827px;
    height: 36px;
    padding-top: 7px;
    padding-left: 17px;
    background-color: #FFFFFF;
    font-size: large;
    font-weight: 700;
}

#MenuWrapper a
{
    /*
		Links in the Menu are white. This gets overriden by styles in chapter 7.
	*/
    color: #FFFFFF;
    
}

.MainMenu
{
    /*
		The Menu gets a white border on all four sides.
	*/
    border: 1px outset #C0C0C0;
    width: 814px;
    height: 19px;
    background-color: #FFFFFF;
    font-size: 18px;
}

#MainContent
{
    /*
		Defines the main content area. The #MainContent element has a minimum height of 500 pixels, but can grow if necessary.
		The font-size is 80% of its parenty element, which in this case comes down to 80% of the font
		the user has specified as the default font in the browser.
	*/
    margin: auto;
    font-size: 0.75em;
    width: 659px;
    border-left: 1px solid white;
    border-right: 2px solid white;
    float: left;
    background-color: #FFFFFF;
    min-height: 500px;
    padding: 10px;
    border: thin double #000000;
}

#Sidebar
{
    /*
		The SideBar is positioned to the right of the MainContent area. It gets the same font-size as #MainContent
		and gets a background image called Sidebar.jpg. To ensure the image is visible in (most) browsers
		on a dmall page, the element gets a minimum height of 500px. This is ignored by IE 6.
	*/
   
    font-size: 0.8em;
    background-image: url(Images/TheSidebar.jpg);
    background-repeat: no-repeat;
    background-color: #33CCCC;
    width: 152px;
    min-height: 511px;
    float: left;
    padding-top: 10px;
	padding-left: 10px;
}

#Footer
{
    /*
		The footer is positioned below all other content (yet still within PageWrapper).
		At the top, it gets a border with a dashed style, while all other sides have no border.
		clear: both is used to clear the impact of the float properties used for #MainContent and #SideBar.
	*/
    clear: both;
    height: 39px;
    background-color: #33CCCC;
    color: White;
    text-align: center;
    font-size: 0.68em;
    font-weight: bold;
    line-height: 39px;
    font-style: inherit;
    font-variant: normal;
    text-transform: lowercase;
}

.TheButton
{
    color: #308462;
}

StaticMenuItemStyle, .StaticMenuItemStyle a
{
    /* Defines the look of main menu items. */
    color: #707070;
    font-size: 15px;
    font-weight: normal;
    text-decoration: none;
    padding-left: 2px;
    word-spacing: normal;
    white-space: pre-wrap;
    text-align: center;
}

.StaticHoverStyle, .StaticSelectedStyle
{
    /* Defines the look of active and hover menu items */
    padding: 3px;
    margin: 3px;
    border: thin inset #003300;
    background-color: #C0C0C0;
}

.DynamicMenuItemStyle
{
	/* Defines the sub menu items */
	font-size: 16px;
	color: #707070;
	background-color: #cccccc;
	padding: 4px 2px 4px 3px;
}
Reply With Quote
  #7 (permalink)  
Old September 1st, 2010, 07:04 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,955
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

You're not applying the CssClass of MainMenu to the Menu:

<asp:menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"
CssClass="MainMenu">


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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
leemark2k3 (September 2nd, 2010)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed imports for Chapter 2 To-Do List Example alex_harding BOOK: Professional Android 2 Application Development 11 March 12th, 2011 08:31 AM
Chapter 14 Code page 620, help needed! Safi BOOK: Beginning ASP 3.0 3 December 8th, 2010 12:43 PM
Chapter 7 p 214 code didn't work, changes needed.. jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 June 20th, 2004 10:06 PM
Chapter 15 - Explanation needed jeyroz BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 June 4th, 2004 12:06 AM



All times are GMT -4. The time now is 10:35 PM.


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