Asp.net 为什么recaptcha.IsValid总是返回True
为什么recaptcha.IsValid总是返回TrueAsp.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
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