Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 17th, 2009, 01:11 AM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Styling the Menu Control

I am doing this exercise and getting strange results...

I copied the Web.sitemap file that is provided to make sure everything in there is correct.

When I run the site, I see this for the links:

Home Reviews Expand Reviews About Expand About Login

And I'm not sure why... Can anyone help?
Reply With Quote
  #2 (permalink)  
Old March 17th, 2009, 01:18 AM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also when I preview the page in Design Mode (MasterPage.master) it says:

Home Reviews About Login
Reply With Quote
  #3 (permalink)  
Old March 17th, 2009, 03:36 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Do you actually see the word Expand?

Can you post the code for the page with the controls and the actual sitemap? Please use the Code button on the toolbar to make the code easier to read...

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
  #4 (permalink)  
Old March 17th, 2009, 08:41 AM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,

Yes I literally see the word Expand in there.

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></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" CssClass="MainMenu" 
          DataSourceID="SiteMapDataSource1" Orientation="Horizontal" 
          StaticEnableDefaultPopOutImage="False">
          <StaticMenuItemStyle ItemSpacing="10px" />
        </asp:Menu>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" 
          ShowStartingNode="False" />
      </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" 
          onselectedindexchanged="lstPreferredTheme_SelectedIndexChanged">
          <asp:ListItem>Monochrome</asp:ListItem>
          <asp:ListItem>DarkGrey</asp:ListItem>
        </asp:DropDownList>
      </div>
      <div id="Footer">Footer Goes Here</div>
    </div>
    </form>
</body>
</html>
Code:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/" title="Home" description="Home">
    <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
    <siteMapNode url="~/Reviews/Default.aspx" title="Reviews" description="Reviews published on this site">
      <siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Reviews Grouped by Genre" />
      <siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Reviews" />
    </siteMapNode>
    <siteMapNode url="~/About/Default.aspx" title="About" description="About this Site">
      <siteMapNode url="~/About/Contact.aspx" title="Contact Us" description="Contact Us" />
      <siteMapNode url="~/About/AboutUs.aspx" title="About Us" description="About Us" />
    </siteMapNode>
    <siteMapNode url="~/Login.aspx" title="Login" description="Log in to this web site" />
  </siteMapNode>
</siteMap>
Thank you!
Reply With Quote
  #5 (permalink)  
Old March 17th, 2009, 09:46 AM
Friend of Wrox
Points: 894, Level: 11
Points: 894, Level: 11 Points: 894, Level: 11 Points: 894, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Are you running this in Firefox? From memory, the menu renders an image for the user to click on to expand the menu. The alt text for this is set to "Expand x".
So run it in IE if possible and there should be a small square instead of Expand, or do a View Source and check what is being output. If it is an image, just put one in the appropriate place on your site so it shows. (Edit->Find is your friend here - the HTML the menu creates isn't very pretty)

Phil
Reply With Quote
  #6 (permalink)  
Old March 17th, 2009, 10:14 AM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm it seems like you're right. I was actually running it with Google Chrome. If I run it in IE it looks fine. Does this mean if I ever use menu's like this I can't accurately view them in Chrome/Firefox? And that would mean that also goes for anyone who views the sites I design... That's inconvenient! Unless I'm misunderstanding?
Reply With Quote
  #7 (permalink)  
Old March 17th, 2009, 01:37 PM
Friend of Wrox
Points: 894, Level: 11
Points: 894, Level: 11 Points: 894, Level: 11 Points: 894, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Strange. The menu has StaticEnableDefaultPopOutImage="false" which should stop any image being rendered at all!
I notice you have a DropDownList to select the theme on the page as well. Can you see in any of the .skin files if this is turned back on? There would be a line looking something like:
Code:
<asp:Menu StaticEnableDefaultPopOutImage="True" />
In whichever case, you should still get an image if this is enabled, as the default is to use an arrow image built into the .NET dlls. This can be overriden by setting StaticPopOutImageUrl in the <asp:Menu> tag, or PopOutImageUrl within an item.

Phil
Reply With Quote
  #8 (permalink)  
Old March 17th, 2009, 02:41 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
Does this mean if I ever use menu's like this I can't accurately view them in Chrome/Firefox?
It works fine on Firefox. The full book was developed and tested on multiple browsers, including IE and Firefox.

Chrome wasn't out by then, so there might be an issue there.

I think that Chrome is not detected as a browser capable of handling menus. You can alter the browser settings on the server or do it at the site level:

http://blog.the-dargans.co.uk/2008/0...work-with.html

(Ckeck out the browser caps reference in the comments )

More info:
http://forums.asp.net/p/1315088/2713325.aspx#2713325
http://www.google.com/search?hl=en&q...chrome&aq=f&oq=

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
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Custom Controls and Styling robzyc ASP.NET 2.0 Basics 4 July 8th, 2008 05:39 AM
PHP Styling adaniels11 PHP How-To 1 April 10th, 2007 05:10 AM
Nav Bar Styling VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 May 16th, 2006 06:02 PM
XSLT and styling jacob XSLT 4 October 13th, 2005 02:50 AM
menu control annieapple VS.NET 2002/2003 1 August 6th, 2003 10:41 AM



All times are GMT -4. The time now is 05:11 PM.


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