Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-04
2
Medium Priority
?
4,123 Views
Last Modified: 2008-01-09

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
Comment
Question by:gusdogs
2 Comments
 
LVL 3

Accepted Solution

by:
Kyanar earned 200 total points
ID: 16390039
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
 

Author Comment

by:gusdogs
ID: 16390485
Thanks a lot Kyanar, got it working.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month20 days, 20 hours left to enroll

810 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