Change Theme Settings
Change Theme Settings
Themes
 
Metropolis
Moderno
iOS
Material
Material Compact
Office 365
Mulberry
Show All Themes
v
...v

Data Binding to SiteMap



This demo illustrates how the BindToSiteMap method can be used to easily populate the Menu for ASP.NET MVC with item information taken from a SiteMap file.

Note that the Menu for ASP.NET MVC is able to automatically retrieve item information by binding to data fields whose names coincide with property names of an item object (such as the Text, NavigateUrl, Image and ToolTip). In this demo, the image path of items is obtained automatically from the corresponding attributes of data source nodes. The texts and navigation locations of items are retrieved from the standard attributes of a SiteMap file - the 'url' and 'title'. The texts of items of the last nested level are composed dynamically, by concatenating the values of the 'result' and 'title' attributes. This processing is performed within a method delegate specified by the ItemDataBound property, which allows you to manipulate the values being assigned to the properties of a menu item during its data binding.