BotDetect ASP.NET CAPTCHA Web UI API Reference
The BotDetect.Web.UI namespace contains BotDetect ASP.NET WebFormsCaptcha controls used within ASP.NET Web Forms applications (equivalent to System.Web.UI).
BotDetect.Web.UI.WebFormsCaptcha
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.WebFormsCaptcha 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 | |
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 UserInputID | Captcha user input textbox identifier used for all server-side and client-side user input processing. The default value is empty (must be set for each Captcha individually) | |
int CodeLength | Number of characters in randomly generated Captcha codes (answers to Captcha challenges). The default value is random (4-6 characters) | |
BotDetect.CodeStyle CodeStyle | Character types, used to generate random Captcha codes. The default value is Alphanumeric | |
string DisallowedCodeSubstringsCsv | Strings that should never occur in randomly generated Captcha codes. Can be both single characters (allows Captcha character set customization) and sequences of two or more characters (useful for swear words filtering, avoiding particular hard-to-read sequences etc.). The default value is empty (Captcha code filtering is optional) | |
List<string> DisallowedCodeSubstringsList | Strings that should never occur in randomly generated Captcha codes. Can be both single characters (allows Captcha character set customization) and sequences of two or more characters (useful for swear words filtering, avoiding particular hard-to-read sequences etc.). The default value is empty (Captcha code filtering is optional) | |
int CodeTimeout | The time period after random Captcha code generation during which Captcha challenges based on it can be solved: when it expires, even correct inputs will be considered as invalid submissions. The default value is 1200 seconds (20 minutes) | |
BotDetect.ImageStyle ImageStyle | Image style, The BotDetect drawing algorithm used to render Captcha codes in image Captcha challenges. The default value is random (an image style is chosen from all available values for each Captcha image generated) | |
System.Drawing.Size ImageSize | Size of Captcha image challenges generated. The default value is 250 x 50 pixels | |
BotDetect.ImageFormat ImageFormat | Image format in which Captcha images will be generated and sent to the client. The default value 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 | |
bool SoundEnabled | Is Captcha sound enabled. The default value is true | |
BotDetect.SoundStyle SoundStyle | The BotDetect audio generation algorithm used to pronounce Captcha codes in sound Captcha challenges. The default value is random (a sound style is chosen from all available values for each Captcha sound generated) | |
BotDetect.SoundFormat SoundFormat | Audio format Captcha sounds will be generated and sent to the client. The default value is WavPcm16bit8kHzMono | |
BotDetect.SoundRegenerationMode SoundRegenerationMode | How will multiple consecutive requests for audio Captcha with the same Captcha code ('sound regeneration') be handled by BotDetect - a tradeoff of security, usability, and storage requirements. The default value is |
|
string Locale | Captcha locale string, determining the exact character set used for random Captcha code generation and the pronunciation language used for sound Captcha generation. The default value is en-US | |
string ImageTooltip | The alternative text of the Captcha image Html element. The default value is Retype the CAPTCHA code from the image | |
string SoundTooltip | Tooltip of the Captcha sound icon. The default value is 'Speak the CAPTCHA code' | |
string ReloadTooltip | Tooltip of the Captcha reload icon. The default value is 'Change the CAPTCHA code' | |
string HelpLinkText | Text or tooltip of the Captcha help link, depending on help link mode. The default value depends on the width of the Captcha image | |
string HelpLinkUrl | Url of the localized Captcha help page the help link points to. The default value depends on Captcha locale. Valid user Captcha help link url setting values are absolute or relative Urls | |
bool ReloadEnabled | Is Captcha reloading (changing the Captcha code because the current one is too hard to read) enabled. The default value is true | |
bool UseSmallIcons | Default BotDetect Captcha icons are 22x22 pixels large, but there is also a smaller set of 17x17 px icons used when the default ones are too large. This settings allows you to control which icon set will be used. The default value is true when the Captcha image height is < 50px, and false otherwise | |
bool UseHorizontalIcons | BotDetect displays the Captcha sound and reload icon one below the other by default, and switches to displaying them one beside the other when Captcha images are small enough. This setting allows you to control which BotDetect icon layout will be used. The default value is true when the Captcha image height is < 40px, and false otherwise | |
string SoundIconUrl | Url of the optional custom Captcha sound icon that will be used instead of the default one. The default value is 'BotDetect.ashx?get=sound-icon' | |
string ReloadIconUrl | Url of the optional custom Captcha reload icon that will be used instead of the default one. The default value is 'BotDetect.ashx?get=reload-icon' | |
int IconsDivWidth | Custom width of the Captcha icons div element. The default value depends on Captcha image height, since BotDetect will automatically determine default icon size and position to match it | |
bool HelpLinkEnabled | Will Captcha markup include a link to a Captcha help page providing Captcha instructions and explanations for form users. The default value is true | |
BotDetect.HelpLinkMode HelpLinkMode | How will the Captcha help link be displayed. The default value is Text | |
override short TabIndex | Starting tabindex for the Captcha container Html markup elements. The default value is empty (Captcha elements won't have an explicit tabindex set) | |
bool AddCssInclude | Should the BotDetect layout stylesheet be automatically added to page <head> if possible. The default value is true | |
string AdditionalCssClasses | User-defined CSS classes that will be added to the BotDetect CAPTCHA container <div>. The default value is empty | |
string AdditionalInlineCss | User-defined CSS style declarations that will be added as inline style of the BotDetect CAPTCHA container <div>. The default value is empty | |
bool AddScriptInclude | Should the BotDetect JavaScript client-side script code be included by the generated Captcha container markup. The default value is true | |
bool AddInitScript | Should the JavaScript code for BotDetect client-side object creation be included in the generated Captcha container markup. The default value is true | |
bool AutoUppercaseInput | Should user Captcha code input be automatically uppercased on the fly. The default value is true | |
bool AutoFocusInput | Should the Captcha code input textbox automatically be assigned focus on all Captcha sound and Captcha reload icon clicks, allowing the users to more easily type in the code as they hear it or as the new image loads. The default value is true | |
bool AutoClearInput | Should the Captcha user input textbox automatically be cleared on all reload icon clicks and auto-reloads of expired Captcha codes. The default value is true | |
bool AutoReloadExpiredCaptchas | Should Captcha challenges automatically be reloaded when the Captcha code expires (controlled by the CodeTimeout property). The default value is true | |
int AutoReloadTimeout | Time period in seconds after which automatic reloading of expired Captcha challenges will cease. The default value is 7200 seconds (2 hours) | |
int SoundStartDelay | Starting delay (in milliseconds) of Captcha audio JavaScript playback. The default value is 0 (no delay) | |
bool RemoteScriptEnabled | Should BotDetect also add a remote JavaScript include (remote.captcha.com/include.js) loaded from the captcha.com server (which is currently used only for stats, but is planned to develop into additional Captcha functionality). The default value is true | |
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.Captcha Captcha | Underlying Captcha instance used by the current Captcha instance. The Web Forms Captcha control delegates much of it's Captcha functionality to the generic Captcha instance | |
EventHandler <InitializedWebCaptchaEventArgsEventArgs> InitializedWebCaptcha | 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 |
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 ASP.NET CAPTCHA
2019-07-22v4.4.2 -
BotDetect Java CAPTCHA
2019-07-22v4.0.Beta3.7 -
BotDetect PHP CAPTCHA
2019-07-22v4.2.5