|
| 1 | +--- |
| 2 | +title: Navigate Through Pages using Menu Component |
| 3 | +description: "Learn how to navigate through the application pages using the Telerik UI for {{ site.product }} Menu component." |
| 4 | +page_title: Navigate Through Pages using the Menu |
| 5 | +slug: menu-navigation-between-pages |
| 6 | +type: how-to |
| 7 | +tags: menu, navigation, url, action, link, routing |
| 8 | +component: menu |
| 9 | +res_type: kb |
| 10 | +--- |
| 11 | + |
| 12 | +## Environment |
| 13 | + |
| 14 | +<table> |
| 15 | + <tbody> |
| 16 | + <tr> |
| 17 | + <td>Product Version</td> |
| 18 | + <td>2025.1.227</td> |
| 19 | + </tr> |
| 20 | + <tr> |
| 21 | + <td>Product</td> |
| 22 | + <td>Menu for Progress® Telerik® {{ site.product_short }}</td> |
| 23 | + </tr> |
| 24 | + </tbody> |
| 25 | +</table> |
| 26 | + |
| 27 | +## Description |
| 28 | + |
| 29 | +How can I configure the Telerik UI for {{ site.product }} Menu to navigate through different pages of my application? |
| 30 | + |
| 31 | +## Solution |
| 32 | + |
| 33 | +The Menu component renders anchor elements (`<a>`) by default. |
| 34 | + |
| 35 | +To navigate to the application pages, configure each item using the `Url()` or `Action()` methods. |
| 36 | + |
| 37 | +```Index.cshtml |
| 38 | +
|
| 39 | + @(Html.Kendo().Menu() |
| 40 | + .Name("menu") |
| 41 | + .Items(menu => |
| 42 | + { |
| 43 | + menu.Add().Text("Home").Url(Url.Action("Index", "Home")); |
| 44 | + menu.Add().Text("About").Url(Url.Action("About", "Home")); |
| 45 | + menu.Add().Text("Contact").Url(Url.Action("Contact", "Home")); |
| 46 | + }) |
| 47 | + ) |
| 48 | +
|
| 49 | +``` |
| 50 | + |
| 51 | +{% if site.core %} |
| 52 | +```TagHelper |
| 53 | + @addTagHelper *, Kendo.Mvc |
| 54 | +
|
| 55 | + <kendo-menu name="menu"> |
| 56 | + <items> |
| 57 | + <menu-item text="Home" url="@Url.Action("Index", "Home")"></menu-item> |
| 58 | + <menu-item text="About" url="@Url.Action("About", "Home")"></menu-item> |
| 59 | + <menu-item text="Contact" url="@Url.Action("Contact", "Home")"></menu-item> |
| 60 | + </items> |
| 61 | + </kendo-menu> |
| 62 | +``` |
| 63 | +{% endif %} |
| 64 | + |
| 65 | +{% if site.core %} |
| 66 | +```C# HomeController.cs |
| 67 | + public class HomeController : Controller |
| 68 | + { |
| 69 | + public IActionResult Index() |
| 70 | + { |
| 71 | + return View(); |
| 72 | + } |
| 73 | + |
| 74 | + public IActionResult About() |
| 75 | + { |
| 76 | + return View(); |
| 77 | + } |
| 78 | + |
| 79 | + public IActionResult Contact() |
| 80 | + { |
| 81 | + return View(); |
| 82 | + } |
| 83 | + } |
| 84 | +``` |
| 85 | +{% else %} |
| 86 | +```C# HomeController.cs |
| 87 | + public class HomeController : Controller |
| 88 | + { |
| 89 | + public ActionResult Index() |
| 90 | + { |
| 91 | + return View(); |
| 92 | + } |
| 93 | + |
| 94 | + public ActionResult About() |
| 95 | + { |
| 96 | + return View(); |
| 97 | + } |
| 98 | + |
| 99 | + public ActionResult Contact() |
| 100 | + { |
| 101 | + return View(); |
| 102 | + } |
| 103 | + } |
| 104 | +``` |
| 105 | +{% endif %} |
| 106 | + |
| 107 | + |
| 108 | +## More {{ site.framework }} Menu Resources |
| 109 | + |
| 110 | +* [{{ site.framework }} Menu Documentation]({%slug htmlhelpers_menu_aspnetcore%}) |
| 111 | + |
| 112 | +* [{{ site.framework }} Menu Demos](https://demos.telerik.com/{{ site.platform }}/menu) |
| 113 | + |
| 114 | +{% if site.core %} |
| 115 | +* [{{ site.framework }} Menu Product Page](https://www.telerik.com/aspnet-core-ui/menu) |
| 116 | + |
| 117 | +* [Telerik UI for {{ site.framework }} Video Onboarding Course (Free for trial users and license holders)]({%slug virtualclass_uiforcore%}) |
| 118 | + |
| 119 | +* [Telerik UI for {{ site.framework }} Forums](https://www.telerik.com/forums/aspnet-core-ui) |
| 120 | + |
| 121 | +{% else %} |
| 122 | +* [{{ site.framework }} Menu Product Page](https://www.telerik.com/aspnet-mvc/menu) |
| 123 | + |
| 124 | +* [Telerik UI for {{ site.framework }} Video Onboarding Course (Free for trial users and license holders)]({%slug virtualclass_uiformvc%}) |
| 125 | + |
| 126 | +* [Telerik UI for {{ site.framework }} Forums](https://www.telerik.com/forums/aspnet-mvc) |
| 127 | +{% endif %} |
| 128 | + |
| 129 | +## See Also |
| 130 | + |
| 131 | +* [Client-Side API Reference of the Menu for {{ site.framework }}](https://docs.telerik.com/kendo-ui/api/javascript/ui/menu) |
| 132 | +* [Server-Side API Reference of the Menu for {{ site.framework }}](https://docs.telerik.com/{{ site.platform }}/menu/api) |
| 133 | +{% if site.core %} |
| 134 | +* [Server-Side TagHelper API Reference of the Menu for {{ site.framework }}](/api/taghelpers/menu) |
| 135 | +{% endif %} |
| 136 | +* [Telerik UI for {{ site.framework }} Breaking Changes]({%slug breakingchanges_2023%}) |
| 137 | +* [Telerik UI for {{ site.framework }} Knowledge Base](https://docs.telerik.com/{{ site.platform }}/knowledge-base) |
0 commit comments