New to Telerik UI for ASP.NET Core? Start a free 30-day trial
Use the Same Controllers in Different Areas in the Menu Items
Environment
Product | Telerik UI for ASP.NET Core Menu |
Product Version | Created with version 2024.4.1112 |
Description
How can I use the same Controllers in different Areas with the Telerik UI for ASP.NET Core Menu?
Solution
Razor
@(Html.Kendo().Menu()
.Name("menu")
.Items(menu =>
{
menu.Add().Text("Home").Action("Index", "Home", new { area = "" });
menu.Add().Text("Area1").Action("Index", "Home", new { area = "ChartInGrid" });
menu.Add().Text("Area2").Action("Index", "Home", new { area = "GridSelectionByField" });
menu.Add().Text("Register").Action("Index", "Home", new { area = "EditorImportExport" }).ContentHtmlAttributes(new { id = "registerLink" });
})
)
For the complete implementation of the suggested approach, refer to the ASP.NET MVC project on how to use the same Controller in different Areas with the Menu component. You can use this as a starting point to configure the same setup in an ASP.NET Core project.