2

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
4

1 に答える 1

3

Captcha.Validate()前に電話するCaptcha.IsValid

    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
于 2012-07-21T07:21:02.297 に答える