문제

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();
    }
}
도움이 되었습니까?

해결책

Set the control's CausesValidation property to false. it will disable validation for a specific control. [MSDN]

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top