Set the control's CausesValidation property to false. it will disable validation for a specific control. [MSDN]
Disable RequiredFieldValidator on a button click
-
08-10-2022 - |
Frage
Im trying to disable RequiredFieldValidator on a button click but I cant seem to figure out how. I've also tried .Enabled property with no luck. This is what I have but its not working. Any help would be appreciated, thank you in advance
protected void btnCreateAccount_Click(object sender, EventArgs e)
{
RequiredFieldValidator3.IsValid = false;
RequiredFieldValidator4.IsValid = false;
{
lblCreateAccount.Text = user.CreateAccount();
}
}
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow