Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 为什么recaptcha.IsValid总是返回True_Asp.net_Captcha_Recaptcha - Fatal编程技术网

Asp.net 为什么recaptcha.IsValid总是返回True

Asp.net 为什么recaptcha.IsValid总是返回True,asp.net,captcha,recaptcha,Asp.net,Captcha,Recaptcha,为什么recaptcha.IsValid总是返回True Protected Sub CreateUserWizard1_CreatingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles CreateUserWizard1.CreatingUser Dim Captcha As RecaptchaControl = CType(Create

为什么recaptcha.IsValid总是返回True

    Protected Sub CreateUserWizard1_CreatingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles CreateUserWizard1.CreatingUser
    Dim Captcha As RecaptchaControl = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("recaptcha1"), RecaptchaControl)
    If Not Captcha.IsValid Then
        e.Cancel = True
    End If
End Sub

Captcha.IsValid之前调用
Captcha.Validate()

    Protected Sub CreateUserWizard1_CreatingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles CreateUserWizard1.CreatingUser
    Dim Captcha As RecaptchaControl = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("recaptcha1"), RecaptchaControl)
    Captcha.Validate()
    If Not Captcha.IsValid Then
        e.Cancel = True
    End If
End Sub