BotDetect Ajax CAPTCHA Documentation

Unlike Recaptcha the Stalker -- BotDetect CAPTCHA works in China! Licensable source-code; self-hosted -- doesn't stalk -- nor does it slurp your form-data! Think: GDPR & LGPD!

This page is an index of BotDetect Captcha documentation regarding Ajax Captcha validation: code examples, how to guides and Ajax implementation options available in different versions of BotDetect.

Related information can be found in similar pages about jQuery Captcha and JavaScript Captcha.


There are several different approaches you can take when implementing Ajax Captcha validation of BotDetect ASP.NET Captcha, depending on your Ajax framework of choice and the amount and format of data exchanged by the client and server during Captcha validation through Ajax requests.

ASP.NET Unobtrusive Validation Ajax Captcha

BotDetect Captcha can be validated as part of ASP.NET unobtrusive validation of form fields in both ASP.NET MVC and ASP.NET WebForms applications. This approach to Ajax Captcha validation is shown in the ASP.NET MVC application template Captcha example and the ASP.NET WebForms application template Captcha example.

Getting the CAPTCHA Validation Result as JSON

If you prefer to handle the Ajax client-side workflow of Captcha validation yourself, you can make an Ajax request to the BotDetect Captcha handler validation end-point Url, available through the ValidationUrl property of the BotDetect client-side object.

For example, if you make an Ajax GET request to

FormCaptcha.ValidationUrl + "&i=" + userCaptchaCodeInput // TODO: read input

you will get the Captcha validation result as a simple true or false JSON value.

Partially Submitting the Form to Validate the CAPTCHA

If you prefer a custom Ajax implementation that submits the user Captcha code input to a custom end-point in your server-side ASP.NET code, you just need to ensure that you submit the CaptchaId and InstanceId values (available as Id and InstanceId properties of the BotDetect client-side object) along with the user input.

You can then get the Captcha validation result by passing these extra parameters to the static Validate() method of the BotDetect.Web.CaptchaControl class:

// TODO: add these values to the Ajax request on the client-side
string userInput = Request.Params["userInput"] as string;
string captchaId = Request.Params["captchaId"] as string;
string instanceId = Request.Params["instanceId"] as string;

bool isHuman = BotDetect.Web.Captcha.Validate(captchaId, userInput,