473,729 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SiteMapProvider and userid

Hey everyone,

My scenario is as follows:
In my website the users session id is constantly passed from page to page on
the URL. I have one main menu that appears the same on each page, one of the
menu items has a set of child items that only appear on hover over.
Essentially, no matter which page the user is on, i want the user id to be
appended to each of the urls in the menu. A further complication is that my
child menu items are dynamic on a day-to-day basis, so they need to come from
a custom datasource.

So far, i've implemented my own SiteMapProvider that inherits from the
StaticSiteMapPr ovider. I've got it to read the static part of the menu from a
sitemap xml file and then dynamically append the other items from a different
source. But getting the userid to work is causing me real problems.

I've seen quite a few examples that suggest you should handle the
SiteMapResolve event (i think it's called that). But all the examples i've
seen only append QueryString parameters to the current node and all parent
nodes... whereas what i want to do is append QueryString parameters onto
every possible item in the menu that the user might click on - and that's the
whole thing.

So, my last attempt was to handle SiteMapResolve and return from it the root
node cloned with each item underneath cloned as well (had to write a deep
clone function) with required user session id appended to all urls. But the
node i return doesn't seem to be used in the rendered menu... so i think i've
got the wrong end of the stick with that.

I really hope someone else has managed this - or can point me in the right
direction.

Apologies for the long post

thanks,
Andrew
Jun 27 '08 #1
1 1484
I would ask this in the forums at www.asp.net, as I would bet someone has
already solve this. I have not, personally, but I see no reason you cannot
walk the entire tree appending the ?userid=### to the URL.

Personally, I think this is unwise, unless you are encoding or encrypting
the ID using a variable salt, as a user can use your scheme to log in as an
administrator, if they only know his unique id. I would not like that
security hole, personally.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Brook" <Br***@discussi ons.microsoft.c omwrote in message
news:8F******** *************** ***********@mic rosoft.com...
Hey everyone,

My scenario is as follows:
In my website the users session id is constantly passed from page to page
on
the URL. I have one main menu that appears the same on each page, one of
the
menu items has a set of child items that only appear on hover over.
Essentially, no matter which page the user is on, i want the user id to be
appended to each of the urls in the menu. A further complication is that
my
child menu items are dynamic on a day-to-day basis, so they need to come
from
a custom datasource.

So far, i've implemented my own SiteMapProvider that inherits from the
StaticSiteMapPr ovider. I've got it to read the static part of the menu
from a
sitemap xml file and then dynamically append the other items from a
different
source. But getting the userid to work is causing me real problems.

I've seen quite a few examples that suggest you should handle the
SiteMapResolve event (i think it's called that). But all the examples i've
seen only append QueryString parameters to the current node and all parent
nodes... whereas what i want to do is append QueryString parameters onto
every possible item in the menu that the user might click on - and that's
the
whole thing.

So, my last attempt was to handle SiteMapResolve and return from it the
root
node cloned with each item underneath cloned as well (had to write a deep
clone function) with required user session id appended to all urls. But
the
node i return doesn't seem to be used in the rendered menu... so i think
i've
got the wrong end of the stick with that.

I really hope someone else has managed this - or can point me in the right
direction.

Apologies for the long post

thanks,
Andrew
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1542
by: RCS | last post by:
All, OK, so I'm working on a template for our new ASP.NET applications. Part of this, includes using the new menu and breadcrumbs control in ASP.NET 2.0 (I'm using beta 2). I put the hierarchy of the applications and navigation in a database, and am able to pull that into the app by inheriting StaticSiteMapProvider. So that's set and works great.
1
1297
by: RCS | last post by:
Does anyone know of a tabbed navigation control that supports SiteMapProvider (the same way the menu, breadcrumbs and treeview do in 2.0)?? I'm looking for www.amazon.com style tabbed navigation, but something that will plug it seamlessly with my exisitng navigation provider. Thanks!
0
1085
by: Thomas Bandt | last post by:
Hi, I wrote my own SiteMapProvider which fetches the data from a Sql Database (Navigation hierarchy). But this data (categories) could contain absolute external Urls (like http://google.com/) as well as duplicate Urls to the same local or external file. In both scenarios the runtime throws an exception. Is there a known workaround?
2
1928
by: dhurwitz | last post by:
Hi, I have written a custom SiteMapProvider to retrieve site map data from a SQL Server database table. It works fine when used as the data source for a Menu control, so I am confident that all the nodes are being correctly populated. However, when used with a TreeView control, only the first node displays. Any suggestions on why this might be the case? Thanks.
0
1419
by: ashish | last post by:
hello all, I am trying to create a custom site map provider and since my site map is very huge, I am loading the required nodes when the CurrentNode property is called.. I am wondering if this would be a performance bottleneck, since according to my understanding a single nstance of sitemapprovider is loaded for the app domain
3
8020
by: Adrian Sharp | last post by:
I've got a pretty basic sitemap setup, but am getting a runtime error: "The SiteMapProvider 'MySiteMap' cannot be found." This occurs only when I access my website under IIS 5.1. When I run my app under the debugger (localhost:1946) I have no problem. I thought of trying IIS6.0, but am running XP, so can't upgrade to 6.0. Any ideas? my web.config relevant lines <siteMap> <providers>
1
4438
by: shapper | last post by:
Hello, How to make a SiteMapDataSource to use a SiteMapProvider defined in Web.Config? I think I should use something like: MySiteMapDataSource.Provider = ... However I don't know what to place in "...". I tried to use a string with the name of the provider but it didn't
0
1399
by: shapper | last post by:
Hello, I need to create a custom SiteMapProvider. I searched in Google for examples but I am still completly lost. The custom SiteMapProvider I need to create is exactly the same as the Asp.Net SiteMapProvider: The only difference is: attribute Visible = "True".
2
1635
by: Steve Harclerode | last post by:
Hi, I have implemented a working SiteMapProvider as shown on an msdn page: http://msdn.microsoft.com/en-us/library/ms178434(VS.80).aspx My question is: Can I make the TreeView that uses a SiteMapProvider show the heirarchy from the current node down, instead of from the root? My scenario is that I have a website with several thousand folders, each folder containing less than 100 pages. What I would like is that if you are
0
8921
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
9284
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9148
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...
1
6722
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
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
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.