Problem with CreateUserWizard

G

Guest

I'm using a CreateUserWizard with an extra WizardStep. My code is based on
this http://msdn2.microsoft.com/en-us/library/ms178342.aspx code.
When the method "protected void CreateUserWizard1_CreatedUser(...)" executes,
using the debugger I can see all entered values (CreateUserWizard1.Password,
CreateUserWizard1.Email EXCEPT CreateUserWizard1.UserName is "",
however this UserName was of course entered. I don't know what happens. Find
hereafter the code snippet for this method:

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
// Determine the checkbox values.
CheckBox subscribeCheckBox =
(CheckBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("SubscribeCheckBox");
CheckBox shareInfoCheckBox =
(CheckBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ShareInfoCheckBox");

// The following line doesn't give the entered UserName value,
// however this was correct entered!
MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);

user.Comment = "Subscribe=" + subscribeCheckBox.Checked.ToString() +
"&" +
"ShareInfo=" + shareInfoCheckBox.Checked.ToString();
Membership.UpdateUser(user);

// Show or hide the labels based on the checkbox values.
Label subscribeLabel =

(Label)CreateUserWizard1.CompleteStep.ContentTemplateContainer.FindControl("SubscribeLabel");
Label shareInfoLabel =

(Label)CreateUserWizard1.CompleteStep.ContentTemplateContainer.FindControl("ShareInfoLabel");

subscribeLabel.Visible = subscribeCheckBox.Checked;
shareInfoLabel.Visible = shareInfoCheckBox.Checked;
}

Anyone suggestions what goes wrong here, i'm completely lost on this.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top