Data Binding Overview
The Telerik UI for ASP.NET MVC Menu provides flexible data binding capabilities that allow you to populate its items from various data sources. You can choose the appropriate binding method based on your application architecture and data requirements.
Data Binding Approaches
The Menu supports the following data binding methods:
Items Binding
Define the Menu items declaratively within the component configuration when using:
- Declarative menu structure with known items.
- Static navigation content that does not require external data sources.
For detailed implementation instructions, refer to the Items Binding documentation.
Model Binding
Bind the Menu to a local dataset by passing an arbitrary model directly within the boundaries of the component. This approach is optimal for small to medium-sized datasets that can be loaded in memory.
For detailed implementation instructions, refer to the Model Binding documentation.
Remote Data Binding
Connect the Menu to a remote endpoint using AJAX requests. This enables:
- Dynamic menu generation using server-side data.
- Real-time menu updates based on user permissions or roles.
- Improved performance with large menu structures through on-demand loading.
For more information and examples, refer to the Remote Data Binding documentation.
Custom Attributes Binding
Implement custom attribute binding for enhanced Menu functionality by applying model binding to populate menu items dynamically from the server while binding HTML attributes to model fields:
- Bind the Menu items to model properties and specify custom HTML attributes.
- Apply client-side logic based on item attributes and selection.
- Create Menu hierarchies with additional metadata.
- Enable attribute-driven Menu behavior and interactions.
For more information, refer to the Custom Attributes Binding documentation.
Sitemap Binding
Bind the Menu to an ASP.NET sitemap for automatic navigation structure generation:
- Integration with XML sitemap files using
SiteMapManager. - Automatic menu hierarchy generation from sitemap structure.
- Support for controller and action routing from sitemap nodes.
For detailed implementation instructions, see Sitemap Binding article.
Key Considerations
When selecting a data binding approach for the Menu, evaluate the following factors:
- Performance