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

Discussion in 'ASP .Net' started by Electrified Research, Sep 21, 2006.

  1. 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.
    Electrified Research, Sep 21, 2006
    #1
    1. Advertising

  2. 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!
    *************************************************
    "Electrified Research" <> wrote in message
    news:...
    > 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.
    >
    Cowboy \(Gregory A. Beamer\), Sep 21, 2006
    #2
    1. Advertising

  3. 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.
    Electrified Research, Sep 21, 2006
    #3
  4. 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. :)
    Electrified Research, Sep 23, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siegfried Heintze
    Replies:
    0
    Views:
    2,250
    Siegfried Heintze
    Oct 24, 2005
  2. Trapulo
    Replies:
    4
    Views:
    22,940
    bharathmr
    Mar 21, 2008
  3. Steve Kershaw
    Replies:
    1
    Views:
    1,307
    Ben Rush
    Apr 11, 2007
  4. Steve Kershaw
    Replies:
    6
    Views:
    3,503
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 11, 2007
  5. donet programmer
    Replies:
    3
    Views:
    1,507
    Gregory A. Beamer
    Nov 20, 2009
Loading...

Share This Page