Personalization: How do I load another user's personalization settings instead of the current user?

  • Thread starter Electrified Research
  • Start date
E

Electrified Research

So I've been playing with WebParts. Very cool stuff. The
personalization scope has "Shared" and "User". "Shared" allows for an
admin to customize a page and how other users see that page. "User"
allows for that user to customize a page how they specifically want.

What I want to do is a fusion of the the two.

The personaliztion settings appear to be based on the request path.
For example.
/Default.aspx and /MyPage.aspx can have different WebParts layouts and
settings.

How can I make it so that a user can customize their own page...
/MyPage.aspx?user=currentusername

.... but when other users view that same URL, they see the
personalization settings for the user specified in the query string.

Any help on this would be great.
 
C

Cowboy \(Gregory A. Beamer\)

I have not personally done this, but have enough experience with the
provider model to at least head you in the right direction. Once you include
any of the membership/role/profile providers, you automatically get certain
items for free, like being able to determine the logged in user. But, you
also have the ability to programatically poke at any of the users, as long
as you know their name. For example:

MembershipUser user = Membership.GetUser("userName");

I can get a user that is not currently logged in in this manner. With the
webpart infrastructure, you may end up having to override some events to
stop if from setting the user's prefrences and getting the chosen value
instead.

Now, one word of warning here. If you are using settings to change values
that really should be part of the functionality of the part, you are
circumventing the natural order and kludging up the system. There is nothing
inherently wrong with this, if it is working, but understand that you are
going to have to train any additional programmers that might work on the
system to your altered reality.

Good luck!

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

*************************************************
Think outside of the box!
*************************************************
 
E

Electrified Research

Thanks for the input!

I'm currently tweaking this out to potentially get it to work. So far,
I have yet to enable "Shared" scope, but it appears that it may be
possible to include the query string. We shall see.
 
E

Electrified Research

So the personalization engine uses physical (or virtual) paths to store
the information. So I am able to allow uses to modify their own shared
scope if I provide them a custom virtual path based on their username.
:) This works. :)
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top