CreateUserWizard problem, what goes wrong?

G

Guest

I'm using a CreateUserWizard with an extra WizardStep.
When the method "protected void CreateUserWizard1_CreatedUser(...) executes,
using the debugger I can see all entered values except the 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

Forum statistics

Threads
474,262
Messages
2,571,043
Members
48,769
Latest member
Clifft

Latest Threads

Top