Skip to main content

ASPxCaptcha Class

A control used for the challenge-response authentication.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public class ASPxCaptcha :


The ASPxCaptcha class implements the functionality of a challenge-response authentication test, which enables verifying that submitted data came from a human, and not a robot or script.


Create a Captcha Control

Design Time

The ASPxCaptcha control is available on the DX.23.1: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxCaptcha ID="Captcha" runat="server" ClientInstanceName="ClientCaptcha">
    <TextBox Position="Bottom" />
    <ValidationSettings SetFocusOnError="true" ErrorDisplayMode="ImageWithText" />

Run Time

using DevExpress.Web;
protected void Page_Load(object sender, EventArgs e)
    ASPxCaptcha captcha = new ASPxCaptcha();
    captcha.ID = "Captcha";

    captcha.ClientInstanceName = "ClientCaptcha";
    captcha.TextBox.Position = DevExpress.Web.Captcha.ControlPosition.Bottom;
    captcha.ValidationSettings.SetFocusOnError = true;
    captcha.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;


DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

The ASPxCaptcha control uses a session state to store a verification code. Therefore, the session state mode attribute should not be Off for the control to operate properly.

The control consists of the following elements:


The ASPxCaptcha control provides you with comprehensive client-side functionality, implemented using JavaScript code:

The control’s client-side API is enabled if the ASPxCaptcha.ClientInstanceName property is defined, or any client event is handled.

See Also