I'm trying to validate the value of a TextBox control that is within my CreateUserWizard before a user is created in my code behind file
Below is what I currently have, the form is submitted regardless of the value that is entered into the TextBox:
public void RegisterNewUser_CreatingUser(object sender, LoginCancelEventArgs e) // System.EventArgs e
{
CreateUserWizard cuw = (CreateUserWizard)sender;
cuw.Email = cuw.UserName;
TextBox valTextBox = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Validate");
var inputVal = valTextBox.Text;
if (inputVal == "9")
{
Response.Redirect("form.aspx");
}
else
{
e.Cancel = true;
Label errorMessage = (Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ErrorMessage");
errorMessa ...
Go to the complete details ...