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
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