• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4125
  • Last Modified:

ASP.NET 2 - "This property cannot be set for anonymous users" when trying to assign values to profile


Hi.

I am using the CreateUserWizard to get a users credentials.
In the CreateUserWizardStep, I have also got textboxes for the users address which
will be assigned to their profile.

In the web.config file, I have allowed all anonymous users to access all pages of the site.

In the CreateUserWizard1_CreatedUser(ByVal....)  sub, which is run after clicking submit,  I am attempting to assign the values of the textboxes to the profile. I get the error message

"The property cannot be set for anonymous users" (When the SET attempts to set the value of the Profile element to the textbox value)

Surely the user is no longer anonymous, after all I am trying to set their profile in the "CreatedUser" sub ?



0
gusdogs
Asked:
gusdogs
1 Solution
 
KyanarCommented:
Is the LoginCreatedUser property of the CreateUserWizard control set to "True" or "False" - it needs to be True for the profile to be accessible via the Profile global.  Otherwise you need to know the user's name and fetch the profile from the system like so:

Dim pro As New ProfileCommon()
pro.Initialize(username, true)

and you would be able to access pro using the same methods as you would the Profile global.
0
 
gusdogsAuthor Commented:
Thanks a lot Kyanar, got it working.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now