Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Updating Profile Information for Authenticated Users

Posted on 2007-08-05
3
Medium Priority
?
688 Views
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;

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

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;
        <asp:createuserwizard
            id="CreateUserWizard1"
            ContinueDestinationPageUrl="~/default.aspx"
            DisableCreatedUser="false"          
            oncreateduser="CreateUserWizard1_CreatedUser"
            LoginCreatedUser="true"
            runat="server">

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

Heeeeelp!

------------------------------------------------------------------------------------------------------------------------------------------
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
0
Comment
Question by:jset_expert
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy earned 800 total points
ID: 19637189
I think you need to take a look at this
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/profile/default.aspx
look for this heading " VB Migrating Profile data from an anonymous user to an authenticated user"
here is the code link
http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/profiles/Migration.src&file=profiles_vb\HomePage.aspx&lang=VB+Source
here is the web.config
http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/profiles/ProfileSchema.src
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
0
 
LVL 1

Author Comment

by:jset_expert
ID: 19637309
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?
0
 
LVL 27

Expert Comment

by:Sammy
ID: 19642672
No Unfortunately it looks like this is the only way to do this.
Migrating the profile is the only option in this case.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

580 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