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

[Solved] Adding area in heirarchical menu model binding doesn't reflect upon menu rendering

0 Answers 16 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.
Steven
Top achievements
Rank 1
Steven asked on 13 Mar 2012, 04:55 PM
I'm using databindng to bind the model to MVC Menu and wanted to introduce area as part of the binding and tested it as follows by setting the routevalues by passsing in a RouteValueDictionary with key pair of area & areaname. When the menu is rendered, the area is not appearing and moreover the link is also not set. Am I doing it worngly or is there a better way to get it working? Your help apprecited.
Html.Telerik().Menu()
            .Name("CustomerMenu")
            .BindTo(hierarchicalMenu, mapping => mapping
                    .For<BaseLevelMenuItem>(binding => binding
                        .Children(c => c.EnumeratedChildren)
                        .ItemDataBound((item, c) =>
                            {
                                item.Text = T(c.ResourceName).Text;
                                if (!String.IsNullOrWhiteSpace(c.ActionName)) item.ActionName = c.ActionName;
                                if (!String.IsNullOrWhiteSpace(c.ControllerName)) item.ControllerName = c.ControllerName;
                                item.RouteValues = new RouteValueDictionary{{"area", "bad"}};
                                item.ImageUrl = String.IsNullOrEmpty(c.ImageURL) ? "" : c.ImageURL;
                            })

 

 

 

Tags
Menu
Asked by
Steven
Top achievements
Rank 1
Share this question
or