MVCxNavBar Class
The object of this type represents a configured instance of the corresponding extension and is intended to be used mainly as a sender parameter when processing events on the server side.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
#Remarks
Note
To add the Nav
The object of the MVCxNavBar type represents the configured instance of DevExpress ASP.NET MVC NavBar extension. The MVCxNavBar object is intended to be used mainly as a sender parameter when processing events on the server side.
The code sample below illustrates how to use the MVCxNavBar object within the delegate method that processes the SettingsBase.PreRender server event.
View code:
@Html.DevExpress().NavBar(settings =>
{
settings.Name = "NavBar";
settings.PreRender = (sender, e) =>
{
MVCxNavBar navbar = (MVCxNavBar)sender;
// Add a new unbound item. All the other items are taken from the bound "~/App_Data/WorldCup2010.sitemap" file
navbar.Items.Add("Unbound Item");
};
}).BindToSiteMap("~/App_Data/WorldCup2010.sitemap").GetHtml()
Note
To properly follow the ASP.