You need to set the .Email
property of the CreateUserWizard
control, not the value of the TextBox
. This is what actually gets passed on the backend to the MembershipProvider's CreateUser
method.
Like this:
protected void RegisterUser_CreatingUser(object sender, EventArgs e)
{
TextBox _txtEmailAddress = (TextBox)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("Email");
Label _lblEmailAddress = (Label)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("lblEmail");
// Set the email property of the CreateUserWizard control to append the domain
RegisterUser.Email = _txtEmailAddress.Text + _lblEmailAddress.Text;
}