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
BotDetect.Web.UI.WebFormsCaptcha public method 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
BotDetect.Web.UI.WebFormsCaptcha 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.WebFormsCaptcha public property string UserInputControlID Captcha user input textbox control identifier. The default value is empty (must be set for each Captcha individually)
BotDetect.Web.UI.WebFormsCaptcha public property 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)
BotDetect.Web.UI.WebFormsCaptcha public property int CodeLength Number of characters in randomly generated Captcha codes (answers to Captcha challenges). The default value is random (4-6 characters)
BotDetect.Web.UI.WebFormsCaptcha public property BotDetect.CodeStyle CodeStyle Character types, used to generate random Captcha codes. The default value is Alphanumeric
BotDetect.Web.UI.WebFormsCaptcha public property 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)
BotDetect.Web.UI.WebFormsCaptcha public property 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)
BotDetect.Web.UI.WebFormsCaptcha public property 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.Web.UI.WebFormsCaptcha public property 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)
BotDetect.Web.UI.WebFormsCaptcha public property System.Drawing.Size ImageSize Size of Captcha image challenges generated. The default value is 250 x 50 pixels
BotDetect.Web.UI.WebFormsCaptcha public property BotDetect.ImageFormat ImageFormat Image format in which Captcha images will be generated and sent to the client. The default value is Jpeg
BotDetect.Web.UI.WebFormsCaptcha public property System.Drawing.Color CustomDarkColor Optional custom dark color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.WebFormsCaptcha public property System.Drawing.Color CustomLightColor Optional custom light color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.WebFormsCaptcha public property bool SoundEnabled Is Captcha sound enabled. The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property 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.Web.UI.WebFormsCaptcha public property BotDetect.SoundFormat SoundFormat Audio format Captcha sounds will be generated and sent to the client. The default value is WavPcm16bit8kHzMono
BotDetect.Web.UI.WebFormsCaptcha public property 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 Limited

BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property string ImageTooltip The alternative text of the Captcha image Html element. The default value is Retype the CAPTCHA code from the image
BotDetect.Web.UI.WebFormsCaptcha public property string SoundTooltip Tooltip of the Captcha sound icon. The default value is 'Speak the CAPTCHA code'
BotDetect.Web.UI.WebFormsCaptcha public property string ReloadTooltip Tooltip of the Captcha reload icon. The default value is 'Change the CAPTCHA code'
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property bool ReloadEnabled Is Captcha reloading (changing the Captcha code because the current one is too hard to read) enabled. The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property 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'
BotDetect.Web.UI.WebFormsCaptcha public property 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'
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property 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.Web.UI.WebFormsCaptcha public property BotDetect.HelpLinkMode HelpLinkMode How will the Captcha help link be displayed. The default value is Text
BotDetect.Web.UI.WebFormsCaptcha public property 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)
BotDetect.Web.UI.WebFormsCaptcha public property bool AddCssInclude Should the BotDetect layout stylesheet be automatically added to page if possible. The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property string AdditionalCssClasses User-defined CSS classes that will be added to the BotDetect CAPTCHA container <div>. The default value is empty
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property bool AddScriptInclude Should the BotDetect JavaScript client-side script code be included by the generated Captcha container markup. The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property bool AutoUppercaseInput Should user Captcha code input be automatically uppercased on the fly. The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public property bool AutoReloadExpiredCaptchas Should Captcha challenges automatically be reloaded when the Captcha code expires (controlled by the CodeTimeout property). The default value is true
BotDetect.Web.UI.WebFormsCaptcha public property int AutoReloadTimeout Time period in seconds after which automatic reloading of expired Captcha challenges will cease. The default value is 7200 seconds (2 hours)
BotDetect.Web.UI.WebFormsCaptcha public property int SoundStartDelay Starting delay (in milliseconds) of Captcha audio JavaScript playback. The default value is 0 (no delay)
BotDetect.Web.UI.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha 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.WebFormsCaptcha public property 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
BotDetect.Web.UI.WebFormsCaptcha public event EventHandler <InitializedWebCaptchaEventArgsEventArgs> InitializedWebCaptcha Custom event handler delegate for InitializedCaptchaControl events, most commonly used for Captcha property randomization
BotDetect.Web.UI.WebFormsCaptcha public event EventHandler <GeneratingCaptchaCode EventArgs> GeneratingCaptchaCode Custom event handler delegate for GeneratingCaptchaCode events, which occur before each Captcha code is generated
BotDetect.Web.UI.WebFormsCaptcha 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.WebFormsCaptcha public event EventHandler <GeneratingCaptchaImage EventArgs> GeneratingCaptchaImage Custom event handler delegate for GeneratingCaptchaImage events, which occur before each Captcha image is generated
BotDetect.Web.UI.WebFormsCaptcha 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.WebFormsCaptcha public event EventHandler <GeneratingCaptchaSound EventArgs> GeneratingCaptchaSound Custom event handler delegate for GeneratingCaptchaSound events, which occur before each Captcha sound is generated
BotDetect.Web.UI.WebFormsCaptcha 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.WebFormsCaptcha public event EventHandler <ValidatingUserInput EventArgs> ValidatingUserInput Custom event handler delegate for ValidatingUserInput events, which occur before each user input is generated
BotDetect.Web.UI.WebFormsCaptcha 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.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