Part 158 Binding asp net menu control to web sitemap file using sitemapdatasource control

  • دعنا نشارك هذا :
ترتيب الدرس : 158
المدة : 00:04:07
التحكم :
Text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.


All ASP .NET Text Articles

All ASP .NET Slides

ASP.NET Playlist

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

This is continuation to Part 157. Please watch Part 157, before proceeding. In Part 155, we discussed binding menu control to an xml file using xmldatasource control.

It is also possible to bind menu control to web.sitemap file.

Here are the steps to achieve this.
1. Add web.sitemap file.

2. Drag and drop "SiteMapDataSource" control onto the webform. By default, a SiteMapDataSource control reads data automatically from web.sitemap file.

3. Finally drag and drop Menu control onto the webform and set DataSourceID attribute, to the ID of the SiteMapDataSource control created in Step 2.

That's it. Run the application and notice that, the Menu control is bound to web.sitemap file. One problem here is that, the Root node is also displayed.

Hiding Root node in the Menu control.
To hide the Root node in the Menu control, set ShowStartingNode attribute of the SiteMapDataSource control to false.

سيتم تفعيل التعليقات قريبا

Sep 23, 2020 07:32:27