Question: Sitemap based on role

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!
 
O

olrbengax

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top