Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 March 21st, 2009, 08:56 PM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default simple menu control issue.. cant believe im posting this

ok so here is my code:

im going for a menu with child items. the syntax looks correct to me however the child items are not showing up... any ideas why?

Code:
 
<asp:Menu
ID="menu1"
OnMenuItemClick="menu1_ItemClicked"
runat="server">
<Items>
<asp:MenuItem
Text="Manufactures:"
Value="Manufactures">
<asp:MenuItemText="One"Value="One"></asp:MenuItem>
<asp:MenuItemText="Two"Value="Two"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
 
Old March 22nd, 2009, 12:41 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Code:
 
      <asp:Menu ID="Menu1" runat="server" StaticDisplayLevels="2" >
          <Items>
             <asp:MenuItem Text="Manufactures:" Value="Manufactures">
                <asp:MenuItem Text="One" Value="One"></asp:MenuItem>
                <asp:MenuItem Text="Two" Value="Two"></asp:MenuItem>
             </asp:MenuItem>
          </Items>
       </asp:Menu>
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old March 22nd, 2009, 12:49 AM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

thanks Lee

but i was hoping to make the child items show on rollovers. i was seeing if this was working at all (in my old code) when i set the forms color to black. I would rollover the menu buttons and a white box shows up. so i know it made them but the text within it doesnt show. any thoughts?
 
Old March 22nd, 2009, 04:42 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Okay, guess you didn't make that very clear. In that case, the code you posted should work.

For example, if you set up an extremely simple example page with no styling, and use the simple menu code you posted, the rollover works without any issues.

If there is an issue with text not showing, that sounds like it is probably a theme or CSS issue, which would be impossible to diagnose with the limited information you've provided. In this case, I would open Firebug, observe the rollover behavior in action, and inspect what styles are being applied to the various menu links.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old March 23rd, 2009, 03:36 PM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

your right. i my post wasnt detailed at all. here is my css:

Code:
 
<style type="text/css">
        a
        {
            color:Yellow;
        }
        div 
        {
            border-color:#CD7F32;
            border-style:ridge;
            border-width:5px;
        }
</style>
and here is my menu control:
it comes out looking like this:
Manufactureres:
->chanelle
-> footwear (wether they sell shoes or not this is just an example)
-> 2nd menu item (aka "Two")
end menu.

Code:
 
<asp:Menu ID="menu1" runat="server" StaticDisplayLevels="5" OnMenuItemClick="menu1_ItemClicked" >
          <Items>
             <asp:MenuItem Text="Manufactures:" Value="Manufactures">
               <asp:MenuItem Text="Chanelle" Value="One">
                <asp:MenuItem Text="Footwear" Value="Footwear"></asp:MenuItem>
               </asp:MenuItem>
               <asp:MenuItem Text="Two" Value="Two"></asp:MenuItem>
             </asp:MenuItem>
          </Items>
       </asp:Menu>
 
Old March 23rd, 2009, 05:11 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

If you change StaticDisplayLevels to ="1", the rollovers will work, so I guess I am still not clear on the problem you're having at this point...
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old March 23rd, 2009, 08:32 PM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

hmmm. that seems wierd... well here is the link. if it works from your end and not mine then its probably my internet explorer... but let me know what it looks like on your screen.

on mine its just grey boxes when i rollover.

aspspider.ws/iceman90289

its just a school assignment.
 
Old March 23rd, 2009, 10:01 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

The rollovers work fine for me, but I think this may be your issue:

HTML Code:
.menu1_0 
{ 
   background-color:white;
   visibility:hidden;
   display:none;
   position:absolute;
   left:0px;top:0px; 
}
 
a
{  
   color:Yellow;
}
This makes yellow links on a white background, which are very hard to see...
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following User Says Thank You to Lee Dumond For This Useful Post:
iceman90289 (March 24th, 2009)
 
Old March 24th, 2009, 01:14 AM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

intresting so i'll make a css class for the menu control and it will all be okay. i'll try this tomorrow. thanks Lee
 
Old March 24th, 2009, 03:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you using IE8? If so, you may have the same problem as described here: IE8 and the Menu

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
simple css menu example horseatingweeds BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 December 14th, 2005 07:30 PM
Posting data from Control to Page bmains ASP.NET 2.0 Basics 1 December 6th, 2005 08:08 PM
Im having a BIG issue here! macupryk General .NET 1 October 10th, 2004 05:24 AM
refreshing a page...simple im sure but i cant do i ps124 ASP.NET 1.0 and 1.1 Basics 1 March 14th, 2004 10:57 AM
Creating simple Menu godhsf80 Javascript 1 November 30th, 2003 12:23 AM





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