Control Panel
Forum
Hosting Help
ASP.NET 4 & SQL 2008 R2 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
AdSense revenue sharing sites
|
Exam 70-680 Practice Tests
|
Silverlight games
Total
members
:
210362
Average new registrations per day (in last 7 days):
16
New Registration:
Open
Register Now
Home
»
Resources
»
Populating TreeView and Menu controls via SiteMap
ASP.NET
ADO.NET
Web Services
Remoting
Visual Studio 2005
Error Bank
Interview Questions
Tips & Tricks
XML
HTML
Jscript/Javascript
IIS
Windows
General
Submit Resource or code snippet
... and get
surprise gifts
Win Digital camera, ASP.NET Books, Free softwares!!
Populating TreeView and Menu controls via SiteMap
15 Oct, 2009
Author:
Michal Karasinski
Summary
Easy dynamic treelike navigation menus.
.NET Classes used :
I'd like to present easy, dynamic navigation menus which can be easily done by a Visual Web Developer user interface. My tutorial includes creating sitemap file and binding it to the Menu component in the Navigation group. Separating that kind of information provides easy management when u need change some links (maybe add or delete) in website. I find it very usefull.
First of all we need to have a sitemap file. To do that, after creating our project type Add New Item and select Site Map. Site Map is a XML based file which sample can be found at the bottom of the topic.
After that step we need to drag interesting component from the ToolBox. For this demo take Menu component from Navigation group (it looks really cool). Next you should choose the data source of that Menu. It can be done in Menu Tasks(rectangle in Top-Right corner of the component) and select
. Next you type SiteMap and give it a name in our project. That's all ! At the end you should get nicely looking navigation menu.
Populating a TreeView looks same as Menu so i wont talk about it, just check it. Only difference is the presentation of the information (navigation links in our case).
Sorry for my bad english and hope that easy tutorial will be usefull in your projects.
Sample Site Map file:
<?xml version=1.0 encoding=utf-8 ?>
< siteMap xmlns=http://schemas.microsoft.com/AspNet/SiteMap-File-1.0 >
< siteMapNode url= title=Menu description=Top>
< siteMapNode url= title=Menu1 description=Software>
< siteMapNode url=~\Page1.aspx title=Demo description=Demo />
< siteMapNode url=~\Page2.aspx title=Demo description=Demo />
</siteMapNode>
< siteMapNode url= title=Menu2 description=Hardware>
< siteMapNode url=~\Page3.aspx title=Demo description=Demo />
< siteMapNode url=~\Page4.aspx title=Demo description=Demo />
</siteMapNode>
</siteMapNode>
</siteMap>
Feedbacks about this page from members:
- No Feedbacks yet !! -
Submit Feedback
View All Feedbacks
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.