473,804 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2042
On Oct 10, 9:50 pm, "VB Programmer" <donotemai...@s omewhere.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4957
by: aa | last post by:
VS2005 BETA2 in web.config it is written: <location path="Gedimai/Ataskaitos"> <system.web> <authorization> <allow roles="Dispeceriai,SDispeceriai,SVisi"/> <deny users="*"/> </authorization>
1
2013
by: chris.rust | last post by:
Has anyone else had any trouble setting up a sitemap view to be filtered by roles? We've put a cust role provider in place, and we can verify that it's only being called once for each connection, and is returning the correct roles, but... When we specify a role on the top sitemapnode that role seems to add to the roles on lower level nodes, so we end up needing to put roles="*" on the top node, but then regardless of which role we put...
0
1416
by: Demetri | last post by:
Hello, I have built a web application with authentication modeled after the following video by Scott Guthrie: http://download.microsoft.com/download/8/3/6/836dd5f8-fa92-499f-8219-0d326f13bf18/hilo_masterpages-nav_FINAL.wmv So I have a site map, a treeview control on a page that binds to the sitemap. I only want certain items on there to be available for certain roles.
5
15084
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would simply persist any changes i made, but it doesn't happen. e.g. selected.ParentNode.ChildNodes.Remove(selected); throws a NotSupportedException "Collection is read-only"
0
1052
by: =?Utf-8?B?c2Vhbl9tY2Fk?= | last post by:
For roles to work on a sitemap is it required to have a role provider setup? And if it is can I set up a role provider without a database? I have simple windows authentication which has roles so I don’t need any database solution. Having said that the bottom line is that my roles functionality for my site map is simply not working but all code behind implementation of roles is working fine. Currently its starting to look like I will...
0
2221
by: Chris | last post by:
Hi, i have a problem with the visibility of my sitemap. There is one role defined: "manager" There are two users: 'user1' (member of role manager) and 'user2' (not member). The login.aspx redirects to a page with a menu control associated to a SiteMapDataSource. I want to hide pg1 for all non-members of role manager (=user2).
0
1466
by: Chris | last post by:
Hi, i have a problem with sitemap combined with roles. I already posted this but i reformulated simplier: here: there are two defined users: user1 and user2 there is one role: manager user1 belongs to the role manager; user2 not. there are three pages (page1.aspx, page2.aspx and page3.aspx).
0
1105
by: tasmontique | last post by:
I have 2 more site maps apart from web.sitemap each site map is based on users role eg Admin,Member,Guest. Is there a way apart from security trimmings to implement a different sitemap apart from web.sitemap. Eg I have 3 masterpages. One for Guest, One For Member, One For Admin. I want on these master pages for the datasource to link to the three different sitemaps based on the users role. Any suggestions or corrections in my logic...
1
2649
by: carlos | last post by:
I am using asp.net 2.0 to bind my menu controls using xml web.sitemaps. I created a sitemap for each role, and what I am trying to do is dynamically bind the menucontrol's datasource with the appropriate sitemap based on the logged in user's role. It is not working though. Any ideas? //Master Page Code Behind protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.