Version

Captcha Validation

WebCaptcha™ control provides the functionality to check its validation status on both server side and client side.

  • On the server side, the control’s Validate method is called automatically when the page loads. During this event you can also use the control’s IsValid property to check if the validation was successful. You may also check the validation status in any other event by calling the control’s Validate method and then checking the control’s IsValid property.

In C#:

this.WebCaptcha1.Validate();
if (this.WebCaptcha1.IsValid)
{
    //add your logic here
}

In Visual Basic:

Me.WebCaptcha1.Validate()
If Me.WebCaptcha1.IsValid Then
'add your logic here
End If
  • On the client side, you can check the validation status by calling the control’s validationFailed property. It indicates whether the Captcha validation has failed on the server.

In Javascript:

var captcha = $IG.WebCaptcha.find('WebCaptcha1'); // gets a reference to the WebCaptcha control
if (captcha.get_validationFailed()) // checks if the validation was successful on the server
{
    //add your logic here
}