BotDetect ASP.NET CAPTCHA Web UI API Reference

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

BotDetect.Web.UI.WebFormsSimpleCaptcha

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

Inherits

System.Web.UI.WebControls.WebControl

BotDetect.Web.UI.WebFormsSimpleCaptcha Class Reference
BotDetect.Web.UI.WebFormsSimpleCaptcha public method bool Validate Validates the SimpleCaptcha, 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.WebFormsSimpleCaptcha public method bool Validate
  • string userInput
Validates the SimpleCaptcha, 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.WebFormsSimpleCaptcha public property string UserInputControlID SimpleCaptcha user input textbox control identifier. The default value is empty (must be set for each SimpleCaptcha individually)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property string UserInputID SimpleCaptcha 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 SimpleCaptcha individually)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property int CodeLength Number of characters in randomly generated Captcha codes (answers to SimpleCaptcha challenges). The default value is random (4-6 characters)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property BotDetect.CodeStyle CodeStyle Character types, used to generate random Captcha codes. The default value is Alphanumeric
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public property int CodeTimeout The time period after random Captcha code generation during which SimpleCaptcha 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.WebFormsSimpleCaptcha public property BotDetect.ImageStyle ImageStyle Image style, The BotDetect drawing algorithm used to render Captcha codes in image SimpleCaptcha challenges. The default value is random (an image style is chosen from all available values for each Captcha image generated)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property System.Drawing.Size ImageSize Size of Captcha image challenges generated. The default value is 250 x 50 pixels
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public property System.Drawing.Color CustomDarkColor Optional custom dark color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.WebFormsSimpleCaptcha public property System.Drawing.Color CustomLightColor Optional custom light color point, modifies the color palette used for Captcha image drawing
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool SoundEnabled Is SimpleCaptcha sound enabled. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property BotDetect.SoundStyle SoundStyle The BotDetect audio generation algorithm used to pronounce Captcha codes in sound SimpleCaptcha challenges. The default value is random (a sound style is chosen from all available values for each SimpleCaptcha sound generated)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property BotDetect.SoundFormat SoundFormat Audio format SimpleCaptcha sounds will be generated and sent to the client. The default value is WavPcm16bit8kHzMono
BotDetect.Web.UI.WebFormsSimpleCaptcha public property BotDetect.SoundRegenerationMode SoundRegenerationMode

How will multiple consecutive requests for audio SimpleCaptcha 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.WebFormsSimpleCaptcha public property string Locale SimpleCaptcha locale string, determining the exact character set used for random Captcha code generation and the pronunciation language used for sound SimpleCaptcha generation. The default value is en-US
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public property string SoundTooltip Tooltip of the SimpleCaptcha sound icon. The default value is 'Speak the CAPTCHA code'
BotDetect.Web.UI.WebFormsSimpleCaptcha public property string ReloadTooltip Tooltip of the SimpleCaptcha reload icon. The default value is 'Change the CAPTCHA code'
BotDetect.Web.UI.WebFormsSimpleCaptcha public property string HelpLinkText Text or tooltip of the SimpleCaptcha help link, depending on help link mode. The default value depends on the width of the Captcha image
BotDetect.Web.UI.WebFormsSimpleCaptcha public property string HelpLinkUrl Url of the localized SimpleCaptcha help page the help link points to. The default value depends on SimpleCaptcha locale. Valid user SimpleCaptcha help link url setting values are absolute or relative Urls
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool ReloadEnabled Is SimpleCaptcha reloading (changing the Captcha code because the current one is too hard to read) enabled. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool UseSmallIcons Default BotDetect SimpleCaptcha 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.WebFormsSimpleCaptcha public property bool UseHorizontalIcons BotDetect displays the SimpleCaptcha 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.WebFormsSimpleCaptcha public property string SoundIconUrl Url of the optional custom SimpleCaptcha sound icon that will be used instead of the default one. The default value is 'BotDetect.ashx?get=sound-icon'
BotDetect.Web.UI.WebFormsSimpleCaptcha public property string ReloadIconUrl Url of the optional custom SimpleCaptcha reload icon that will be used instead of the default one. The default value is 'BotDetect.ashx?get=reload-icon'
BotDetect.Web.UI.WebFormsSimpleCaptcha public property int IconsDivWidth Custom width of the SimpleCaptcha 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.WebFormsSimpleCaptcha public property bool HelpLinkEnabled Will SimpleCaptcha markup include a link to a SimpleCaptcha help page providing SimpleCaptcha instructions and explanations for form users. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property BotDetect.HelpLinkMode HelpLinkMode How will the SimpleCaptcha help link be displayed. The default value is Text
BotDetect.Web.UI.WebFormsSimpleCaptcha public property override short TabIndex Starting tabindex for the SimpleCaptcha container Html markup elements. The default value is empty (SimpleCaptcha elements won't have an explicit tabindex set)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool AddCssInclude Should the BotDetect layout stylesheet be automatically added to page if possible. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public property bool AddScriptInclude Should the BotDetect JavaScript client-side script code be included by the generated SimpleCaptcha container markup. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool AddInitScript Should the JavaScript code for BotDetect client-side object creation be included in the generated SimpleCaptcha container markup. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool AutoUppercaseInput Should user Captcha code input be automatically uppercased on the fly. The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property bool AutoFocusInput Should the Captcha code input textbox automatically be assigned focus on all SimpleCaptcha sound and SimpleCaptcha 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.WebFormsSimpleCaptcha public property bool AutoClearInput Should the SimpleCaptcha 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.WebFormsSimpleCaptcha public property bool AutoReloadExpiredCaptchas Should SimpleCaptcha challenges automatically be reloaded when the Captcha code expires (controlled by the CodeTimeout property). The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property int AutoReloadTimeout Time period in seconds after which automatic reloading of expired SimpleCaptcha challenges will cease. The default value is 7200 seconds (2 hours)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property int SoundStartDelay Starting delay (in milliseconds) of SimpleCaptcha audio JavaScript playback. The default value is 0 (no delay)
BotDetect.Web.UI.WebFormsSimpleCaptcha 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 SimpleCaptcha functionality). The default value is true
BotDetect.Web.UI.WebFormsSimpleCaptcha public property readonly string CaptchaStyleName Unique identifier of the SimpleCaptcha control within the application (for example, if you placed one SimpleCaptcha control on the Registration page and another on the Contact Us, they would have distinct CaptchaStyleName values)
BotDetect.Web.UI.WebFormsSimpleCaptcha public property readonly BotDetect. Web.SimpleCaptcha SimpleCaptcha Underlying SimpleCaptcha instance used by the current SimpleCaptcha instance. The Web Forms SimpleCaptcha control delegates much of it's SimpleCaptcha functionality to the generic SimpleCaptcha instance
BotDetect.Web.UI.WebFormsSimpleCaptcha public event EventHandler <InitializedWebCaptchaEventArgsEventArgs> InitializedWebCaptcha Custom event handler delegate for InitializedCaptchaControl events, most commonly used for SimpleCaptcha property randomization
BotDetect.Web.UI.WebFormsSimpleCaptcha public event EventHandler <GeneratingCaptchaCode EventArgs> GeneratingCaptchaCode Custom event handler delegate for GeneratingCaptchaCode events, which occur before each Captcha code is generated
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public event EventHandler <GeneratingCaptchaImage EventArgs> GeneratingCaptchaImage Custom event handler delegate for GeneratingCaptchaImage events, which occur before each Captcha image is generated
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.WebFormsSimpleCaptcha public event EventHandler <GeneratingCaptchaSound EventArgs> GeneratingCaptchaSound Custom event handler delegate for GeneratingCaptchaSound events, which occur before each SimpleCaptcha sound is generated
BotDetect.Web.UI.WebFormsSimpleCaptcha public event EventHandler <GeneratedCaptchaSound EventArgs> GeneratedCaptchaSound Custom event handler delegate for GeneratedCaptchaSound events, which occur after each SimpleCaptcha sound has been generated
BotDetect.Web.UI.WebFormsSimpleCaptcha public event EventHandler <ValidatingUserInput EventArgs> ValidatingUserInput Custom event handler delegate for ValidatingUserInput events, which occur before each user input is generated
BotDetect.Web.UI.WebFormsSimpleCaptcha 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.SimpleCaptchaValidator

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

Inherits

System.Web.UI.WebControls.BaseValidator

BotDetect.Web.UI.SimpleCaptchaValidator Class Reference
BotDetect.Web.UI.SimpleCaptchaValidator public method void Validate BaseValidator override, performs server-side SimpleCaptcha validation and updates the IsValid status
BotDetect.Web.UI.SimpleCaptchaValidator public property string CaptchaControl ASP.NET ID of the SimpleCaptcha control the validator validates
BotDetect.Web.UI.SimpleCaptchaValidator public property string ControlToValidate ASP.NET ID of the TextBox or other text input control the validator validates
BotDetect.Web.UI.SimpleCaptchaValidator public property string ErrorMessage Inherited from BaseValidator, the error message shown when SimpleCaptcha validation fails
BotDetect.Web.UI.SimpleCaptchaValidator 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 SimpleCaptcha validation on the server (i.e. Ajax SimpleCaptcha validation is not implemented in this validator class)
BotDetect.Web.UI.SimpleCaptchaValidator public property bool SetFocusOnError Inherited from BaseValidator, should the user input field be focused when SimpleCaptcha validation fails
BotDetect.Web.UI.SimpleCaptchaValidator public property bool IsValid Inherited from BaseValidator, has the SimpleCaptcha validation been successfully passed