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

Create a menu

1 Answer 106 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 17 Dec 2012, 07:13 PM
I'm trying to test the menu using the example code on the site, but I'm getting the following error:

Value cannot be null.
Parameter name: item


Line 9:      <div id="IslandWebMenu">
Line 10:         @(Html.Kendo().Menu()
Line 11:             .Name("Menu")
Line 12:             .Items(items =>

Can, anyone, help me?

Thanks

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Dec 2012, 02:44 PM
Hello Carlos,

This error could be thrown if the name is not specified. Since the Name method is used, the problem could be caused by not closing the explicit code nugget. The Menu should look similar to the one in the snippet below:

@(Html.Kendo().Menu()
   .Name("Menu")
   .Items(items => {
       items.Add().Text("Home").Action("Index", "Home");
       items.Add().Text("About").Action("About", "Home");
   })
)

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
Carlos
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or