This is a migrated thread and some comments may be shown as answers.

[Solved] Setting ID on sub menu UL

0 Answers 23 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig
Top achievements
Rank 1
Craig asked on 28 Feb 2011, 08:20 PM
I'm trying to get an id on the ul's in sub menus. I've tried putting the HtmlAttributes(new { @id="toolsMenu" }) call in a few places but can't seem to figure out where to put it to get the id on the <ul>.

In the code snippet below, I've shown the two places I've tried calling the HtmlAttributes method. The comment after the call explains where the Telerik control is actually putting the id.

@(Html.Telerik().Menu()
    .Name("mainMenu")
    .Items(menu =>
    {
menu.Add()
.Text("Tools")
.Items(item =>
{
item.Add().Text("Add To Toolbox").HtmlAttributes(new {@id="toolsMenu"}); @* puts the id on the "Add To Toolbox" <li>*@
item.Add().Text("Toolbox");
}).HtmlAttributes(new {@id="toolsMenu"}); @* puts the id on the "Tools" <li>*@
menu.Add()
.Text("Setup")
.Items(item =>
{
item.Add().Text("Print Header");
item.Add().Text("MenuLabelAccountInformation");
});
 }).OpenOnClick(true))
Tags
Menu
Asked by
Craig
Top achievements
Rank 1
Share this question
or