Skip to main content

ASPxCaptcha.CodeLength Property

Gets or sets the code length displayed within the editor’s challenge image.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public int CodeLength { get; set; }

Property Value

Type Default Description
Int32 5

An integer value that represents the displayed code length.


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;
        Captcha.CharacterSet = tbCharacterSet.Text;
    if (int.TryParse(seCodeLength.Text, out parseResult))
        Captcha.CodeLength = parseResult;
See Also