Setting Profile properties for not logged in users

Discussion in 'ASP .Net' started by Iain, Nov 24, 2005.

  1. Iain

    Iain Guest

    I create a user using Membership.CreateUser

    Now I want to set a profile property for that user - of course they are not
    logged in, so the profile is of the current user (the administator).

    How do I change a profile setting for a user who is not logged in?

    A related question. How can I change the logged in user programmatically?

    Thanks


    Iain
    --
    Iain Downs (DirectShow MVP)
    Commercial Software Therapist
    www.idcl.co.uk
    Iain, Nov 24, 2005
    #1
    1. Advertising

  2. Hi Iain,

    you'll have to enable anonymous identification and mark profile
    properties in a special way. The following web.config file shows how to
    do this:

    <configuration>
    <system.web>
    <anonymousIdentification enabled="true"/>
    <profile>
    <properties>
    <add name="MyProperty" type="String" allowAnonymous="true"/>
    </properties>
    </profile>
    </system.web>
    </configuration>

    You can change who is logged in using the FormsAuthentication class for
    instance. You'll have to log out the current user first I think.

    Grtz, Wouter
    Trainer - Info Support - www.infosupport.com
    www.dive-in-it.nl
    Wouter van Vugt, Nov 24, 2005
    #2
    1. Advertising

  3. Iain

    Iain Guest

    On 24 Nov 2005 06:47:39 -0800, Wouter van Vugt wrote:

    > Hi Iain,
    >
    > you'll have to enable anonymous identification and mark profile
    > properties in a special way. The following web.config file shows how to
    > do this:
    >
    > <configuration>
    > <system.web>
    > <anonymousIdentification enabled="true"/>
    > <profile>
    > <properties>
    > <add name="MyProperty" type="String" allowAnonymous="true"/>
    > </properties>
    > </profile>
    > </system.web>
    > </configuration>
    >
    > You can change who is logged in using the FormsAuthentication class for
    > instance. You'll have to log out the current user first I think.


    Thanks for your response.

    I am not using anonymous, my users must be authorised!

    And I must say I coudl not see how to login a different user
    FormsAuthentication class (I can SIgnOUt, but I can't see how to sign in
    programatically - or is that just done mby call SetAuthCookie?)

    THanks again

    (Confused!)

    Iain
    --
    Iain Downs (DirectShow MVP)
    Commercial Software Therapist
    www.idcl.co.uk
    Iain, Nov 24, 2005
    #3
  4. Use RedirectFromLoginPage

    Grtz, Wouter
    Wouter van Vugt, Nov 25, 2005
    #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. SR
    Replies:
    0
    Views:
    338
  2. keithb
    Replies:
    0
    Views:
    616
    keithb
    Feb 16, 2006
  3. Brad
    Replies:
    1
    Views:
    1,119
    Roedy Green
    Jul 19, 2005
  4. Replies:
    1
    Views:
    929
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  5. Steven
    Replies:
    5
    Views:
    463
    Steven
    Oct 24, 2008
Loading...

Share This Page