469,134 Members | 1,290 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,134 developers. It's quick & easy.

asp:menu borders

Does anybody know how I would get borders around each menuitem? Do I
have incorportate into a table? Thanks. The below produces a border
around the entire menu.

<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#FFC080"
BorderColor="Olive" BorderStyle="Ridge"
BorderWidth="1px" ForeColor="Navy">
<Items>
<asp:MenuItem NavigateUrl="default.aspx?s=fences"
Text="Fence Styles" Value="Fences">
</asp:MenuItem>
<asp:MenuItem NavigateUrl="default.aspx?s=gates"
Text="Gate Styles" Value="Gates"></asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>

Jul 18 '06 #1
2 5133
Jason,

Each menu item has styles properties. Go into the properties for the menu
items themselves and set the border via style sheets there.

Here is a white paper about using styles with .net objects including the
menu object:
http://www.asp.net/CSSAdapters/WhitePaper.aspx
Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<ja***@cyberpine.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Does anybody know how I would get borders around each menuitem? Do I
have incorportate into a table? Thanks. The below produces a border
around the entire menu.

<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#FFC080"
BorderColor="Olive" BorderStyle="Ridge"
BorderWidth="1px" ForeColor="Navy">
<Items>
<asp:MenuItem NavigateUrl="default.aspx?s=fences"
Text="Fence Styles" Value="Fences">
</asp:MenuItem>
<asp:MenuItem NavigateUrl="default.aspx?s=gates"
Text="Gate Styles" Value="Gates"></asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>

Jul 18 '06 #2
You could also do it through CSS with out adjusting the controls
properties for each menu item.

set the cssclass property of the menu to a css class with some of your
menu's style attributes... ex:

..menu_class
{
background-color:#ffffff;
}

then to access the cells themselves you should be able to do that by
adding a td to the css class. ex:

..menu_class td
{
border:1px solid #000000;
}

my code might be a little off, i'm going off the top of my head, I do
remeber this working for me with out having to go in and mess with the
control properties.
S. Justin Gengo wrote:
Jason,

Each menu item has styles properties. Go into the properties for the menu
items themselves and set the border via style sheets there.

Here is a white paper about using styles with .net objects including the
menu object:
http://www.asp.net/CSSAdapters/WhitePaper.aspx
Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<ja***@cyberpine.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Does anybody know how I would get borders around each menuitem? Do I
have incorportate into a table? Thanks. The below produces a border
around the entire menu.

<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#FFC080"
BorderColor="Olive" BorderStyle="Ridge"
BorderWidth="1px" ForeColor="Navy">
<Items>
<asp:MenuItem NavigateUrl="default.aspx?s=fences"
Text="Fence Styles" Value="Fences">
</asp:MenuItem>
<asp:MenuItem NavigateUrl="default.aspx?s=gates"
Text="Gate Styles" Value="Gates"></asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>
Jul 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Chuck Hartman | last post: by
7 posts views Thread by tfsmag | last post: by
4 posts views Thread by Ben | last post: by
reply views Thread by jason | last post: by
2 posts views Thread by Kevin L. Kitchens | last post: by
2 posts views Thread by Steve Richter | last post: by
3 posts views Thread by win | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.