471,123 Members | 854 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

Question: Sitemap based on role

Using ASP.NET 2.0 with Memberships.

I have 2 folders, admin and client. Each folder has a sitemap file,
admin.sitemap and client.sitemap, in the appropriate directory.

I have a master page with a menu control.

How can I load the correct sitemap file into the menu control based on the
user's current role?

Thanks!
Oct 11 '07 #1
1 1953
On Oct 10, 9:50 pm, "VB Programmer" <donotemai...@somewhere.com>
wrote:
Using ASP.NET 2.0 with Memberships.

I have 2 folders, admin and client. Each folder has a sitemap file,
admin.sitemap and client.sitemap, in the appropriate directory.

I have a master page with a menu control.

How can I load the correct sitemap file into the menu control based on the
user's current role?

Thanks!
If both parts of the site use the same master page, then I think you
could probably check which role the user is in on Page_Load, and then
set the SiteMapProvider property of the SiteMap Data source on the
page to the name of the appropriate SiteMap provider. The menu would
just be using the SiteMap data source like it would be if there was
only one sitemap, but you could leave the SiteMapProvider property of
the datasource blank since you're setting it in Page_Load. Both of
the sitemaps would need to be put in your web.config.

Oliver

Oct 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by aa | last post: by
1 post views Thread by chris.rust | last post: by
reply views Thread by Demetri | last post: by
5 posts views Thread by Tim Mackey | last post: by
reply views Thread by =?Utf-8?B?c2Vhbl9tY2Fk?= | last post: by
reply views Thread by Chris | last post: by
reply views Thread by Chris | last post: by
1 post views Thread by carlos | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.