Home All Groups Group Topic Archive Search About

Setting Profile properties for not logged in users

Author
24 Nov 2005 2:31 PM
Iain
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

Author
24 Nov 2005 2:47 PM
Wouter van Vugt
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
Are all your drivers up to date? click for free checkup

Author
24 Nov 2005 3:53 PM
Iain
On 24 Nov 2005 06:47:39 -0800, Wouter van Vugt wrote:

Show quoteHide quote
> 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
Author
25 Nov 2005 11:06 PM
Wouter van Vugt
Use RedirectFromLoginPage

Grtz, Wouter

Bookmark and Share