BotDetect ASP.NET CAPTCHA Web UI API Reference
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 | ||
|---|---|---|
![]() |
bool Validate
|
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 |
![]() |
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 |
![]() |
string Locale | Locale string, affects the character set used for Captcha code generation and the pronunciation language used for Captcha sound generation |
![]() |
int CodeLength | Length (number of characters) of the Captcha code rendered; the default value is 5 |
![]() |
BotDetect.CodeStyle CodeStyle | Code style, i.e. the algorithm used to generate Captcha codes; the default value is Alphanumeric |
![]() |
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.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 |
![]() |
System.Drawing.Size ImageSize | Size of the Captcha image rendered; the default size is (250, 50) |
![]() |
BotDetect.ImageFormat ImageFormat | Image format in which the Captcha image will be rendered; the default format is JPEG |
![]() |
System.Drawing.Color CustomDarkColor | Optional custom dark color point, modifies the color palette used for Captcha image drawing |
![]() |
System.Drawing.Color CustomLightColor | Optional custom light color point, modifies the color palette used for Captcha image drawing |
![]() |
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.SoundFormat SoundFormat | Audio format in which the Captcha sound will be generated; the default format is WawPcm16bit8kHzMono |
![]() |
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 |
![]() |
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 |
![]() |
int IconsDivWidth | Calculated width of the Captcha icons <div>, can be user-set to create custom icon layouts |
![]() |
short TabIndex | Starting tabindex for the Captcha control Html output. There are three keyboard-selectable Captcha markup elements: the Captcha image help link, the Captcha sound icon and the Captcha reload icon. Depending on your settings (whether the Captcha help link is enabled, are Captcha sounds enabled, is Captcha reloading enabled), the next available tabindex on the page can be from 0 to 3 greater than this value. |
![]() |
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) |
![]() |
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 |
![]() |
EventHandler <InitializedCaptchaControl EventArgs> InitializedCaptchaControl | Custom event handler delegate for InitializedCaptchaControl events, most commonly used for Captcha property randomization |
![]() |
EventHandler <GeneratingCaptchaCode EventArgs> GeneratingCaptchaCode | Custom event handler delegate for GeneratingCaptchaCode events, which occur before each Captcha code is generated |
![]() |
EventHandler <GeneratedCaptchaCode EventArgs> GeneratedCaptchaCode | Custom event handler delegate for GeneratedCaptchaCode events, which occur after each Captcha code has been generated |
![]() |
EventHandler <GeneratingCaptchaImage EventArgs> GeneratingCaptchaImage | Custom event handler delegate for GeneratingCaptchaImage events, which occur before each Captcha image is generated |
![]() |
EventHandler <GeneratedCaptchaImage EventArgs> GeneratedCaptchaImage | Custom event handler delegate for GeneratedCaptchaImage events, which occur after each Captcha image has been generated |
![]() |
EventHandler <GeneratingCaptchaSound EventArgs> GeneratingCaptchaSound | Custom event handler delegate for GeneratingCaptchaSound events, which occur before each Captcha sound is generated |
![]() |
EventHandler <GeneratedCaptchaSound EventArgs> GeneratedCaptchaSound | Custom event handler delegate for GeneratedCaptchaSound events, which occur after each Captcha sound has been generated |
![]() |
EventHandler <ValidatingUserInput EventArgs> ValidatingUserInput | Custom event handler delegate for ValidatingUserInput events, which occur before each user input is generated |
![]() |
EventHandler <ValidatedUserInput EventArgs> ValidatedUserInput | Custom event handler delegate for ValidatedUserInput events, which occur after each user input has been generated |
![]() |
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 | ||
|---|---|---|
![]() |
void Validate | BaseValidator override, performs server-side Captcha validation and updates the IsValid status |
![]() |
string CaptchaControl | ASP.NET ID of the Captcha control the validator validates |
![]() |
string ControlToValidate | ASP.NET ID of the TextBox or other text input control the validator validates |
![]() |
string ErrorMessage | Inherited from BaseValidator, the error message shown when Captcha validation fails |
![]() |
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) |
![]() |
bool SetFocusOnError | Inherited from BaseValidator, should the user input field be focused when Captcha validation fails |
![]() |
bool IsValid | Inherited from BaseValidator, has the Captcha validation been successfully passed |
Current BotDetect Versions
- BotDetect PHP CAPTCHA v3.0.Alpha12012–02–06
- BotDetect ASP.NET CAPTCHA v3.0.92011–11–21
- BotDetect ASP Classic CAPTCHA v3.0.92011–11–21









