|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Menu Question: How to change background for every other root itemI have a horizontal menu and at the toor leverl, I need to change every other
one's background color. Assume, I have the following menu: "A" "B" "C" "D" And I want B and D to be black background white text when first displayed. I can see hwo to change all items through CSS but how do I change individual menu items without changing all lt the same level? Well,
The short answer is, I don't think there's an easy way. However, here's something you can do: <DynamicItemTemplate> <div style='width:100%;height:100%;background-color:<%# Container.ItemIndex % 2 == 0 ? "Black" : "White" %>;color:<%# Container.ItemIndex % 2 == 0 ? "White" : "Black" %>'><%# Eval("Text") %></div> </DynamicItemTemplate> This goes into your Menu control's innerXml (i.e. the stuff between the beginning and end tags of the asp:Menu control). You'll need a lot of tweaking for this to act as nice as the original menu template. I'd try to infer the original template first, and then just add this tweak to set the style in the DIVs. Cheers, Kelly Show quoteHide quote "va" wrote: > I have a horizontal menu and at the toor leverl, I need to change every other > one's background color. Assume, I have the following menu: > "A" "B" "C" "D" > > And I want B and D to be black background white text when first displayed. > I can see hwo to change all items through CSS but how do I change individual > menu items without changing all lt the same level?
FileUpload, Wizard, and saving the data
Web Standards Compliance - Autopostback / Javascript off access control in a Repeater from javascript Wizard, goto page, need to set values of a control in a Repeater asp.net menu to show only parent, siblings and children as static menus Set file extensions for FileUpload delete rows in dataset Custom Web Control and Default Height/Width Dynamic Menu Control in ASP.NET2 User Control question - REPOSTED |
|||||||||||||||||||||||