ASP.NET v2 Menu StaticItemTemplate

B

benjamin.soulier

Hello to everybody,

I Wanted to know if anyone get an item in <asp:menu> to be selected,
defining display of items using StaticItemTemplate. I thought
specifying a css class for StaticSelected or StaticItemSelected should
work, but even using standart parameter of styles within the object,
this does not work.

My code :

StaticitemTemplate in page.aspx:
<StaticItemTemplate>
<table border=0 width=100%>
<tr>
<td><a href="<%# Eval("NavigateUrl")%>"><%#
Eval("Text")%></a></td>
</tr>
</table>
</StaticItemTemplate>

To select an item:
protected void TopMenu_MenuItemDataBound(object sender, MenuEventArgs
e)
{
MenuItem item = e.Item;
if (item.ValuePath == "AboutUs/Default.aspx")
{
item.Selected = true;
}
}

Hope someone can help ;-)

Thanks to all in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top