BotDetect ASP.NET CAPTCHA Web UI API Reference (BotDetect v3.0; deprecated)

The BotDetect.Web.UI namespace contains BotDetect ASP.NET Captcha controls used within ASP.NET Web Forms applications (equivalent to System.Web.UI).

BotDetect.Web.UI.Captcha

The ASP.NET Custom Web Control used to add Captcha protection to ASP.NET Web Forms applications.

Inherits

System.Web.UI.WebControls.WebControl

BotDetect.Web.UI.Captcha Class Reference
BotDetect.Web.UI.Captcha public method bool Validate
  • string userInput
Validates the Captcha, comparing the user input to the Captcha code stored on the server. Each randomly generated Captcha code can only be validated once, regardless of the validation result
BotDetect.Web.UI.Captcha public property string UserInputClientID User input textbox client-side identifier (the ASP.NET ClientID property), used for all client-side user input processing, e.g. automatic user input lowercasing and focusing
BotDetect.Web.UI.Captcha public property string Locale Locale string, affects the character set used for Captcha code generation and the pronunciation language used for Captcha sound generation
BotDetect.Web.UI.Captcha public property int CodeLength Length (number of characters) of the Captcha code rendered; the default value is 5
BotDetect.Web.UI.Captcha public property BotDetect.CodeStyle CodeStyle Code style, i.e. the algorithm used to generate Captcha codes; the default value is Alphanumeric
BotDetect.Web.UI.Captcha public property string CustomCharacterSetName Optional name of the user-defined character set used for Captcha code generation. A collection of custom character sets can be defined in the <botDetect> section of the web.config file
BotDetect.Web.UI.Captcha public property BotDetect.ImageStyle ImageStyle Image style, i.e. the algorithm used to render Captcha codes in images; if no image style is set, it is randomized by default
BotDetect.Web.UI.Captcha public property System.Drawing.Size ImageSize Size of the Captcha image rendered; the default size is (250, 50)
BotDetect.Web.UI.Captcha public property BotDetect.ImageFormat ImageFormat Image format in which the Captcha image will be rendered; the default format is JPEG
BotDetect.Web.UI.Captcha public property System.Drawing.Color CustomDarkColor Optional custom dark color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.Captcha public property System.Drawing.Color CustomLightColor Optional custom light color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.Captcha public property BotDetect.SoundStyle SoundStyle Sound style, i.e. the algorithm used to pronounce Captcha codes in sounds; if no sound style is set, it is randomized by default
BotDetect.Web.UI.Captcha public property BotDetect.SoundFormat SoundFormat Audio format in which the Captcha sound will be generated; the default format is WawPcm16bit8kHzMono
BotDetect.Web.UI.Captcha public property BotDetect.SoundRegenerationMode SoundRegenerationMode

Sound regeneration mode determining how will multiple consecutive requests for audio Captcha with the same Captcha code be handled by BotDetect; the default mode is Limited.

BotDetect.Web.UI.Captcha public property string CaptchaImageTooltip The Captcha image tooltip can be set for the entire application using web.config settings; this instance property allows overriding those values dynamically.
BotDetect.Web.UI.Captcha public property string ReloadIconTooltip The Captcha reload icon tooltip can be set for the entire application using web.config settings; this instance property allows overriding those values dynamically.
BotDetect.Web.UI.Captcha public property string SoundIconTooltip The Captcha sound icon tooltip can be set for the entire application using web.config settings; this instance property allows overriding those values dynamically.
BotDetect.Web.UI.Captcha public property bool UseHorizontalIcons By default, tells is the selected Captcha image height so low that we should switch to horizontal icon rendering; can be user-specified to always (or never) switch to the horizontal icon layout
BotDetect.Web.UI.Captcha public property bool UseSmallIcons By default, tells is the selected Captcha image height so low that we should switch to smaller icons; can be user-specified to always (or never) use small icons
BotDetect.Web.UI.Captcha public property int IconsDivWidth Calculated width of the Captcha icons <div>, can be user-set to create custom icon layouts
BotDetect.Web.UI.Captcha public property short TabIndex

Starting tabindex for the Captcha control Html output.

The keyboard-selectable Captcha markup elements are: the Captcha reload icon, the Captcha sound icon, and (only in the Free version of BotDetect) the BotDetect website link.

Depending on your settings (is Captcha reloading enabled, are Captcha sounds enabled) and the version of BotDetect you are using (free or paid), the next available tabindex on the page can be from 0 to 3 greater than this value.
BotDetect.Web.UI.Captcha public property readonly string CaptchaId Unique identifier of the Captcha control within the application (for example, if you placed one Captcha control on the Registration page and another on the Contact Us, they would have distinct CaptchaId values)
BotDetect.Web.UI.Captcha public property readonly BotDetect. Web.CaptchaControl CaptchaControl Underlying CaptchaControl instance used by the current Captcha instance. The Web Forms Captcha control delegates much of it's Captcha functionality to the abstract CaptchaControl instance
BotDetect.Web.UI.Captcha public event EventHandler <InitializedCaptchaControl EventArgs> InitializedCaptchaControl Custom event handler delegate for InitializedCaptchaControl events, most commonly used for Captcha property randomization
BotDetect.Web.UI.Captcha public event EventHandler <GeneratingCaptchaCode EventArgs> GeneratingCaptchaCode Custom event handler delegate for GeneratingCaptchaCode events, which occur before each Captcha code is generated
BotDetect.Web.UI.Captcha public event EventHandler <GeneratedCaptchaCode EventArgs> GeneratedCaptchaCode Custom event handler delegate for GeneratedCaptchaCode events, which occur after each Captcha code has been generated
BotDetect.Web.UI.Captcha public event EventHandler <GeneratingCaptchaImage EventArgs> GeneratingCaptchaImage Custom event handler delegate for GeneratingCaptchaImage events, which occur before each Captcha image is generated
BotDetect.Web.UI.Captcha public event EventHandler <GeneratedCaptchaImage EventArgs> GeneratedCaptchaImage Custom event handler delegate for GeneratedCaptchaImage events, which occur after each Captcha image has been generated
BotDetect.Web.UI.Captcha public event EventHandler <GeneratingCaptchaSound EventArgs> GeneratingCaptchaSound Custom event handler delegate for GeneratingCaptchaSound events, which occur before each Captcha sound is generated
BotDetect.Web.UI.Captcha public event EventHandler <GeneratedCaptchaSound EventArgs> GeneratedCaptchaSound Custom event handler delegate for GeneratedCaptchaSound events, which occur after each Captcha sound has been generated
BotDetect.Web.UI.Captcha public event EventHandler <ValidatingUserInput EventArgs> ValidatingUserInput Custom event handler delegate for ValidatingUserInput events, which occur before each user input is generated
BotDetect.Web.UI.Captcha public event EventHandler <ValidatedUserInput EventArgs> ValidatedUserInput Custom event handler delegate for ValidatedUserInput events, which occur after each user input has been generated
BotDetect.Web.UI.Captcha public property static System.Collections. Generic.List<string> BannedSequences Optional global list of sequences which will be filtered out of the randomly generated Captcha codes, used for example for swear-word filtering

BotDetect.Web.UI.CaptchaValidator

An ASP.NET Validator used to integrate Captcha validation with other field validators and validation summaries. Requires a Captcha control instance and a text input field.

Inherits

System.Web.UI.WebControls.BaseValidator

BotDetect.Web.UI.CaptchaValidator Class Reference
BotDetect.Web.UI.CaptchaValidator public method void Validate BaseValidator override, performs server-side Captcha validation and updates the IsValid status
BotDetect.Web.UI.CaptchaValidator public property string CaptchaControl ASP.NET ID of the Captcha control the validator validates
BotDetect.Web.UI.CaptchaValidator public property string ControlToValidate ASP.NET ID of the TextBox or other text input control the validator validates
BotDetect.Web.UI.CaptchaValidator public property string ErrorMessage Inherited from BaseValidator, the error message shown when Captcha validation fails
BotDetect.Web.UI.CaptchaValidator public property bool EnableClientScript Inherited from BaseValidator, should client-side validation be enabled; note that the control only validates the user input is not empty on the client side, and performs actual Captcha validation on the server (i.e. Ajax Captcha validation is not implemented in this validator class)
BotDetect.Web.UI.CaptchaValidator public property bool SetFocusOnError Inherited from BaseValidator, should the user input field be focused when Captcha validation fails
BotDetect.Web.UI.CaptchaValidator public property bool IsValid Inherited from BaseValidator, has the Captcha validation been successfully passed

Please Note

The information on this page is out of date and applies to a deprecated version of BotDetect™ CAPTCHA (v3.0).

An up-to-date equivalent page for the latest BotDetect Captcha release (v4) is BotDetect v4 Captcha documentation index.

General information about the major improvements in the current BotDetect release can be found at the What's New in BotDetect v4.0 page.