Updating Profile Information for Authenticated Users

Posted on 2007-08-05
Last Modified: 2013-11-05
I am having problems updating user profiles for authenticated users.

I have a login control with some custom profile fields;

        <add name="firstName" allowAnonymous="true"/>
        <add name="lastName" allowAnonymous="true"/>

My VB function looks like this;
    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
        Profile.firstName = firstName.Text
        Profile.lastName = lastName.Text
    End Sub

I can get this to work for anonymous users, but I obviously want this to work for authenticated user.

I have set the following properties;

But I still receieve the error "This property cannot be set for anonymous users".


Further this this my user is not logging in automatically, if I run the following test, the user is registered but the profile is not updated;

        If Context.User.Identity.IsAuthenticated Then
            Profile.userName = txtFirstName.Text
        End If
Question by:jset_expert
    LVL 27

    Accepted Solution

    I think you need to take a look at this
    look for this heading " VB Migrating Profile data from an anonymous user to an authenticated user"
    here is the code link\HomePage.aspx&lang=VB+Source
    here is the web.config
    you will see 2 profiles created and there are merged using VB.NET based on the events/actions taken by the user
    I am assuming you have one profile in your web.config

    if you have any problems post back
    LVL 1

    Author Comment

    Thanks sammy,

    So your saying the only way to do this is to turn on Anonymous Access, and then migrate once the user is logged in.

    Do you know if there is a way to do this without turning on anonymous access?
    LVL 27

    Expert Comment

    No Unfortunately it looks like this is the only way to do this.
    Migrating the profile is the only option in this case.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now