This question is locked. New answers and comments are not allowed.
I am having trouble getting the Binding to Model to work. If I only have the test property populated on the menu item everything works great. As soon as I try adding a Url or action and controller I run into problems. In the simplest test I tried just adding a url to the child items, but in doing so only the first level of the menu shows up. The children are no longer rendered.
My code example below is pulled from the telerik examples with just the Url being populated as the only thing that was changed. Before adding this everything renders fine, but with no way to have the link direct to the page I need is a little useless. Can you point out what I'm doing wrong?
<%= Html.Telerik().Menu()
.Name("Menu")
.BindTo(Model, mappings =>
{
mappings.For<TestSite.OM.Category>(binding => binding
.ItemDataBound((item, category) =>
{
item.Text = category.CategoryName;
})
.Children(category => category.Products));
mappings.For<TestSite.OM.Product>(binding => binding
.ItemDataBound((item, product) =>
{
item.Text = product.ProductName;
item.Url = "http://localhost/ViewItem/" + product.ProductName;
}));
})
%>
My code example below is pulled from the telerik examples with just the Url being populated as the only thing that was changed. Before adding this everything renders fine, but with no way to have the link direct to the page I need is a little useless. Can you point out what I'm doing wrong?
<%= Html.Telerik().Menu()
.Name("Menu")
.BindTo(Model, mappings =>
{
mappings.For<TestSite.OM.Category>(binding => binding
.ItemDataBound((item, category) =>
{
item.Text = category.CategoryName;
})
.Children(category => category.Products));
mappings.For<TestSite.OM.Product>(binding => binding
.ItemDataBound((item, product) =>
{
item.Text = product.ProductName;
item.Url = "http://localhost/ViewItem/" + product.ProductName;
}));
})
%>