 |
| 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
|
|
|
|

March 21st, 2009, 08:56 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
|
|
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>
|
|

March 22nd, 2009, 12:41 AM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
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>
|
|

March 22nd, 2009, 12:49 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
|
|
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?
|
|

March 22nd, 2009, 04:42 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
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.
|
|

March 23rd, 2009, 03:36 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
|
|
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>
|
|

March 23rd, 2009, 05:11 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
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...
|
|

March 23rd, 2009, 08:32 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
|
|
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.
|
|

March 23rd, 2009, 10:01 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
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...
|
|
The Following User Says Thank You to Lee Dumond For This Useful Post:
|
|
|

March 24th, 2009, 01:14 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
|
|
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
|
|

March 24th, 2009, 03:38 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Are you using IE8? If so, you may have the same problem as described here: IE8 and the Menu
Imar
|
|
 |