KaranGupta
asked on
Separater in asp:menu
Hi
I am using <asp:Menu/> control. Inside the control I have 4 links. Between the links I want a separator '|'.
How can I achieve this?
Regards
Karan Gupta
I am using <asp:Menu/> control. Inside the control I have 4 links. Between the links I want a separator '|'.
How can I achieve this?
Regards
Karan Gupta
ASKER
Hi Alfred1
I am not using any sitemapsource. I am using like this
<asp:MenuItem Text="link1"></asp:MenuIte m>
<asp:MenuItem Text="link2"></asp:MenuIte m>
<asp:MenuItem Text="link3"></asp:MenuIte m>
<asp:MenuItem Text="link4"></asp:MenuIte m>
Now if I add one <asp:menu Text="|"> between link1 and link2 then it will act as a separator as per your suggestion. But the problem with this approach
1. If the put cursor on the separator I can see the hand cursor on it which is wrong as it should not act as a link.
2. If I apply hover style then it will apply to the separator as well.
Regards
Karan Gupta
I am not using any sitemapsource. I am using like this
<asp:MenuItem Text="link1"></asp:MenuIte
<asp:MenuItem Text="link2"></asp:MenuIte
<asp:MenuItem Text="link3"></asp:MenuIte
<asp:MenuItem Text="link4"></asp:MenuIte
Now if I add one <asp:menu Text="|"> between link1 and link2 then it will act as a separator as per your suggestion. But the problem with this approach
1. If the put cursor on the separator I can see the hand cursor on it which is wrong as it should not act as a link.
2. If I apply hover style then it will apply to the separator as well.
Regards
Karan Gupta
Maybe you could just use a table. For example see below. Also, why do you have four menus when you could just use one menu and use a sitemapdatasource for the four links?
<table>
<tr>
<td>
<asp:MenuItem Text="link1"></asp:MenuItem>
</td>
<td>|</td>
<td>
<asp:MenuItem Text="link2"></asp:MenuItem>
</td>
<td>|</td>
<td>
<asp:MenuItem Text="link3"></asp:MenuItem>
</td>
<td>|</td>
<td>
<asp:MenuItem Text="link4"></asp:MenuItem>
</td
</tr>
</table>
Hi
Refer following menu with Separater
- Deepak Lakkad
Refer following menu with Separater
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Text="Home" Value="Home"></asp:MenuItem>
<asp:MenuItem Text="|" Value="|"></asp:MenuItem>
<asp:MenuItem Text="About Us" Value="About Us"></asp:MenuItem>
<asp:MenuItem Text="|" Value="|"></asp:MenuItem>
<asp:MenuItem Text="Services" Value="Services"></asp:MenuItem>
<asp:MenuItem Text="|" Value="|"></asp:MenuItem>
<asp:MenuItem Text="Products" Value="Products"></asp:MenuItem>
</Items>
</asp:Menu>
- Deepak Lakkad
to keep separater disabled use following code
<asp:MenuItem Text="|" Value="|" Enabled="false"></asp:Menu Item>
- Deepak Lakkad
<asp:MenuItem Text="|" Value="|" Enabled="false"></asp:Menu
- Deepak Lakkad
Oops. Ignore my previous post. I didn't realize MenuItems against Menu. So it is just one menu.
ASKER
Hi deepaklakkad
<asp:MenuItem Text="|" Value="|" Enabled="false"></asp:Menu Item>
works but there is one more problem. If the color of menu item is blank and if I disable it then it is changed to white color. Can I set the color of separator.
Regards
Karan Gupta
<asp:MenuItem Text="|" Value="|" Enabled="false"></asp:Menu
works but there is one more problem. If the color of menu item is blank and if I disable it then it is changed to white color. Can I set the color of separator.
Regards
Karan Gupta
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode title="Home" description="Home" url="~/default.aspx">
<siteMapNode title="Products" description="Our products"
url="~/Products.aspx">
<siteMapNode title="Hardware" description="Hardware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software" description="Software choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="|" description="" url="" />
<siteMapNode title="Services" description="Services we offer"
url="~/Services.aspx">
<siteMapNode title="Training" description="Training classes"
url="~/Training.aspx" />
<siteMapNode title="Consulting" description="Consulting services"
url="~/Consulting.aspx" />
<siteMapNode title="Support" description="Supports plans"
url="~/Support.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>