G
Guest
I've created my own version of the CreateUserWizard control that gathers up
all the information I need when a user requests an account. Once all the
data is gathered and validated, the FinishButtonClick property calls a method
that does the following:
1. Creates the user account:
Membership.CreateUser(myName, myPwd, myName, myQue, myAns, true, out
createStatus);
(I'm using the email address (myName) as the username, which is why it shows
up twice)
2. I then want to update the newly created user's profile with the
information that was entered:
Profile.UserInfo.UserEmail = UserName.Text;
Profile.UserInfo.FirstName = FirstName.Text;
Profile.UserInfo.MiddleInitial = MI.Text;
...etc.
I do not want these profiles created for anonymous users, so my web.config
file looks like this:
<anonymousIdentification enabled="false" />
<properties>
<group name="UserInfo">
<add name="FirstName" type="System.String" allowAnonymous="false" />
<add name="MiddleInitial" type="System.String"
allowAnonymous="false" />
<add name="LastName" type="System.String" allowAnonymous="false" />
...etc.
</group>
</properties>
I have tried several methods to ensure that the newly created user is logged
in, by using the Membership.ValidateUser(), the
FormsAuthentications.AuthorizeUser(), and none of them have worked. However
the MembershipUser object returned by the CreateUser method shows that that
user is currently OnLine. I always end up with the following error message
the moment I try to call the SetPropertyValue of the first profile property:
"This property cannot be set for anonymous users."
Note that I do not want the user to be able to log in yet until their
account has been approved, so once the profile info is created I would have
to log them out and set their account to Inactive.
Thanks for any and all help.
all the information I need when a user requests an account. Once all the
data is gathered and validated, the FinishButtonClick property calls a method
that does the following:
1. Creates the user account:
Membership.CreateUser(myName, myPwd, myName, myQue, myAns, true, out
createStatus);
(I'm using the email address (myName) as the username, which is why it shows
up twice)
2. I then want to update the newly created user's profile with the
information that was entered:
Profile.UserInfo.UserEmail = UserName.Text;
Profile.UserInfo.FirstName = FirstName.Text;
Profile.UserInfo.MiddleInitial = MI.Text;
...etc.
I do not want these profiles created for anonymous users, so my web.config
file looks like this:
<anonymousIdentification enabled="false" />
<properties>
<group name="UserInfo">
<add name="FirstName" type="System.String" allowAnonymous="false" />
<add name="MiddleInitial" type="System.String"
allowAnonymous="false" />
<add name="LastName" type="System.String" allowAnonymous="false" />
...etc.
</group>
</properties>
I have tried several methods to ensure that the newly created user is logged
in, by using the Membership.ValidateUser(), the
FormsAuthentications.AuthorizeUser(), and none of them have worked. However
the MembershipUser object returned by the CreateUser method shows that that
user is currently OnLine. I always end up with the following error message
the moment I try to call the SetPropertyValue of the first profile property:
"This property cannot be set for anonymous users."
Note that I do not want the user to be able to log in yet until their
account has been approved, so once the profile info is created I would have
to log them out and set their account to Inactive.
Thanks for any and all help.