Reputation: 17281
I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another.
root
--link 1
(...)
--link 10
--link 11
(...)
--link 20
However, sitemap file MUST have a root which I cannot seem to suppress.
Any thoughts?
-Edoode
Upvotes: 1
Views: 2014
Reputation: 1290
You can suppress the root node by doing the following:
SiteMapDataSource ds = new SiteMapDataSource();
ds.SiteMapProvider = "providername";
ds.ShowStartingNode = false;
TreeView1.DataSource = ds;
TreeView1.DataBind();
I use this method to hide the root node for tree views.
Upvotes: 2
Reputation:
Is there any reason that you can't add a dummy root node and then subclass the ASP.NET menu control to ignore your dummy "root" node?
You should be able to tell your SiteMapProvider to use different site maps for the menu.
The other question I have is what's the purpose of having multiple sitemap files? I'm sure you have a valid reason for this, but knowing what's going on would make it easier to understand and come up with a better solution.
That being said, I would come up with a homegrown menu system. You could use jQuery and the superfish plugin on the front end and use C# to read your site map files on the back end to build the menuing structure.
Upvotes: 1