Skip to main content
A newer version of this page is available. .
Tab

ASPxCaptcha.CharacterSet Property

Gets or sets the set of characters used by the editor to generate the code displayed on the challenge image.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue("abcdefhjklmnpqrstuvxyz23456789")]
public string CharacterSet { get; set; }

Property Value

Type Default Description
String "abcdefhjklmnpqrstuvxyz23456789"

A String value that specifies the set of characters.

Remarks

Use the CharacterSet property to specify the allowed characters (as a sequence of characters) for generating the code displayed on the editor’s challenge image.

Example

The following part of the ASPxCaptcha - Features online demo illustrates how to customize the characters set used to generate the challenge image’s code (ASPxCaptcha.CharacterSet) and specify this code length (ASPxCaptcha.CodeLength).

This settings are specified within a panel (ASPxTextBox, ASPxSpinEdit editors) and applied to the captcha control via the Apply button (ASPxButton).

protected void btnApply_Click(object sender, EventArgs e) {
...
    int parseResult = 0;
    if(tbCharacterSet.IsValid)
        Captcha.CharacterSet = tbCharacterSet.Text;
    if (int.TryParse(seCodeLength.Text, out parseResult))
        Captcha.CodeLength = parseResult;
...
}
See Also