Question: Sitemap based on role

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

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!
 
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
 
Back
Top