This question is locked. New answers and comments are not allowed.
I am using the BindTo() method to bind a collection to a menu, and one of the Urls that I set is a javascript style link (javascript:DoSomething() ). When I pass in a string like this, the menu item doesn't appear at all. If I pass in a relative or absolute URL it will work fine. I need to be able to have a javascript link. Below is the code that I'm using:
In this case, child.Link will have the value "javascript:alertDialog.show();", but the menu item doesn't appear at all with this value.
It appears to be a problem with the code in the Telerik MVC dll since when viewing the HTML markup produced, it doesn't even render it.
| Html.Telerik().Menu().Name("MainMenu").BindTo(menuItems, mappings => |
| { |
| mappings.For<MenuContainer>(binding => binding |
| .ItemDataBound((item, parent) => |
| { |
| item.Text = parent.Text; |
| if (!string.IsNullOrEmpty(parent.Link)) |
| { |
| item.Url = parent.Link; |
| } |
| }) |
| .Children(children => children.MenuItems)); |
| mappings.For<Sc.Neo.Portal.ViewModel.MenuItem>(binding => binding |
| .ItemDataBound((item, child) => |
| { |
| item.Text = child.Text; |
| item.Url = child.Link; |
| })); |
| } |
| ).Render(); |
In this case, child.Link will have the value "javascript:alertDialog.show();", but the menu item doesn't appear at all with this value.
It appears to be a problem with the code in the Telerik MVC dll since when viewing the HTML markup produced, it doesn't even render it.