I’m using Telerik MVC Menu to render my mainmenu.
Following code is the line where a certain menu item gets built up:
item.Add().Text("Address").ImageUrl("~/Content/Images/Icons/house.png").Action("index", "basicdata", new {basicdatatype=BasicDataType.ADDRESS});
I expect the url to become: localhost/basicdata/address
But it actually renders: localhost/basicdata?basicdatatype=address
I’d like to get that enum in my Controller as so:
public ActionResult Index(BasicDataType basicDataType)
{
//Code here
}
But it doesn’t work because the URL isn’t in the right format. Can someone help out?
EDIT:
Even the following renders the wrong url:
item.Add().Text("Test").Action<BasicDataController>(o => o.Index(BasicDataType.PROJECT));
As you are using areas, you have to specify that area when linking to it from outside: