Setting Profile properties for not logged in users

I

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
 
W

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
 
I

Iain

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
 

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,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top