B
beaudetious
I'm working on an ASP.NET 2.0 web app using C# and SQL Server 2000. I've
created a multi-step user profile page using the wizard web control and when
the user clicks on the finish button on the final screen I have code in the
click event on the server that does the following:
- Creates a new user using Membership.CreateUser()
- Adds this new user to a default role using Roles.AddUserToRole()
- Inserts the other form fields into various tables in the DB
- Sends a confirmation email
What I'd like to do now is to add some of the fields (i.e. First Name and
Last Name) to the Profile class (which is already setup properly via my
web.Config file). I'm doing the following:
Profile.FirstName = txtFirstName.Text;
Profile.LastName = txtLastName.Text;
However, I'm getting a Provider.ProviderException stating "This property
cannot be set for anonymous users.". Checking the NewUserInfo properties it
appears this newly created user is logged in and shouldn't be anonymous.
So, given the brief overview of what I've done and how I've accomplished it,
how do I now authenticate this newly created user behind the scenes so that I
can associate this profile data with this user? When all is said and done, I
do not mind if the user is pre-authenticated and pre-authorized after
following all of my registration steps. Who'd want to fill out one more
form just to login at this point?
beaudetious
created a multi-step user profile page using the wizard web control and when
the user clicks on the finish button on the final screen I have code in the
click event on the server that does the following:
- Creates a new user using Membership.CreateUser()
- Adds this new user to a default role using Roles.AddUserToRole()
- Inserts the other form fields into various tables in the DB
- Sends a confirmation email
What I'd like to do now is to add some of the fields (i.e. First Name and
Last Name) to the Profile class (which is already setup properly via my
web.Config file). I'm doing the following:
Profile.FirstName = txtFirstName.Text;
Profile.LastName = txtLastName.Text;
However, I'm getting a Provider.ProviderException stating "This property
cannot be set for anonymous users.". Checking the NewUserInfo properties it
appears this newly created user is logged in and shouldn't be anonymous.
So, given the brief overview of what I've done and how I've accomplished it,
how do I now authenticate this newly created user behind the scenes so that I
can associate this profile data with this user? When all is said and done, I
do not mind if the user is pre-authenticated and pre-authorized after
following all of my registration steps. Who'd want to fill out one more
form just to login at this point?
beaudetious