C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

How to add Sitemap to Treeview control


Posted Date: 03 Jul 2009    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: UltimateRenganMember Level: Diamond    
Rating: 1 out of 5Points: 15 (Rs 10)



Add the Sitemap to project:-
step 1:-
Right click the project Name
Step 2:-
Choose the AddnewItem
Step 3:-
AddNewItem window will display
Step 4:-
Choose the SiteMap then ok

The sitemap look like:-

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="">
<siteMapNode url="" title="" description="" />
<siteMapNode url="" title="" description="" />
</siteMapNode>
</siteMap>


U change the sitemap like this

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="xxx" title="xxxxxxx" description="asdf">
<siteMapNode url="Default2.aspx" title="NextPage" description="asd" />
<siteMapNode url="" title="" description="" />
</siteMapNode>
</siteMap>



just drag and drop the treeview control to form.
Assign the DatasourceID property of the treeview control to "SiteMapDataSource1".



<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1">
</asp:TreeView>




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
How to add Sitemap to Treeview control  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Dynamic controls with Validation
Previous Resource: create Dynamic XML file using Data from a SQL Database Table
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use