Saving profile information for a specific user when not logged in

Discussion in 'ASP .Net' started by daokfella, Apr 30, 2007.

  1. daokfella

    daokfella Guest

    I want to be able to store profile information for a user when they
    sign up for an account...but BEFORE they can log in. Can this be done
    using any of the built-in profile methods?

    Here's my current sign-up procedure:

    1. User creates an account with username, password, e-mail and other
    information that I want to store in profile.

    2. User is created as inactive and NOT logged in. Besides the profile
    stuff, I use the membership object to accomplish this. I want to
    store profile information right here while they are NOT logged in.

    3. I send an e-mail to the user with an activate link. The link is to
    an activate page with the UserId guid added as a querystring.

    4. After visiting the activate link (and thus validating their e-mail
    account) they are activated. I read the guid from the querystring.
    Using the membership object, I look up the user by the guid and
    activate them.

    I'm using a custom SQLTableProvider for the profile info (storing in
    separate columns), so I know I could just use my custom sprocs to
    insert the data. But I was wondering if I could do so using the
    default provider object. None of my profile items allow anonymous. I'm
    wondering if I can load a profile for a specific user and set the
    properties.

    Thanks,

    Jason
    daokfella, Apr 30, 2007
    #1
    1. Advertising

  2. Short answer:
    <system.web>
    <anonymousIdentification enabled="true"/>
    <trust level="Medium"/>
    <profile >
    <properties>
    <add name="Name" allowAnonymous="true" />
    <add name="Age" allowAnonymous="true" type="System.Int16"/>
    </properties>
    </profile>
    <compilation debug="true"/>
    </system.web>

    --Peter
    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "daokfella" wrote:

    > I want to be able to store profile information for a user when they
    > sign up for an account...but BEFORE they can log in. Can this be done
    > using any of the built-in profile methods?
    >
    > Here's my current sign-up procedure:
    >
    > 1. User creates an account with username, password, e-mail and other
    > information that I want to store in profile.
    >
    > 2. User is created as inactive and NOT logged in. Besides the profile
    > stuff, I use the membership object to accomplish this. I want to
    > store profile information right here while they are NOT logged in.
    >
    > 3. I send an e-mail to the user with an activate link. The link is to
    > an activate page with the UserId guid added as a querystring.
    >
    > 4. After visiting the activate link (and thus validating their e-mail
    > account) they are activated. I read the guid from the querystring.
    > Using the membership object, I look up the user by the guid and
    > activate them.
    >
    > I'm using a custom SQLTableProvider for the profile info (storing in
    > separate columns), so I know I could just use my custom sprocs to
    > insert the data. But I was wondering if I could do so using the
    > default provider object. None of my profile items allow anonymous. I'm
    > wondering if I can load a profile for a specific user and set the
    > properties.
    >
    > Thanks,
    >
    > Jason
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Apr 30, 2007
    #2
    1. Advertising

  3. daokfella

    daokfella Guest

    Yes, that will allow me to store profile information. But how does
    that create a profile record with the same userId as the membership I
    just created?
    daokfella, Apr 30, 2007
    #3
  4. Re: Saving profile information for a specific user when not logged

    It doesn't and you don't. You use the MigrateAnonymous event:

    http://msdn2.microsoft.com/en-us/library/system.web.profile.profilemodule.migrateanonymous.aspx
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "daokfella" wrote:

    > Yes, that will allow me to store profile information. But how does
    > that create a profile record with the same userId as the membership I
    > just created?
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Apr 30, 2007
    #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. Iain
    Replies:
    3
    Views:
    424
    Wouter van Vugt
    Nov 25, 2005
  2. SR
    Replies:
    0
    Views:
    341
  3. keithb
    Replies:
    0
    Views:
    624
    keithb
    Feb 16, 2006
  4. Brad
    Replies:
    1
    Views:
    1,125
    Roedy Green
    Jul 19, 2005
  5. Replies:
    1
    Views:
    937
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
Loading...

Share This Page