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

Posted on 2006-04-04
Last Modified: 2008-01-09


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 ?

Question by:gusdogs
    LVL 3

    Accepted Solution

    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.

    Author Comment

    Thanks a lot Kyanar, got it working.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    779 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

    9 Experts available now in Live!

    Get 1:1 Help Now