Part 161 Binding asp net treeview control to web sitemap file using sitemapdatasource control

  • دعنا نشارك هذا :
ترتيب الدرس : 161
المدة : 00:04:11
التحكم :
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 160. Please watch Part 160, before proceeding. In Part 158, we discussed binding menu control to web.sitemap file using sitemapdatasource control. Binding treeview control to web.sitemap file is similar.

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 TreeView 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 treeview control is bound to web.sitemap file. One problem here is that, the Root node is also displayed.

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

To open the target page in a new window set Target attribute of TreeView control to _blank.

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

Sep 23, 2020 07:32:27