Skip to main content

ASPxCaptcha.Code Property

Gets the textual representation of the code automatically generated by the control and displayed within the challenge image.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

NuGet Package: DevExpress.Web


public virtual string Code { get; protected set; }

Property Value

Type Description

A String value representing the automatically generated code.


We recommend you to check the Code property value in the Page.Init event handler because the control generates the code before the Page_Load event. You get a different captcha code in all event handlers that occur later than the Page.Init event. Refer to the BC4085 - ASPxCaptcha - The Captcha code’s generation logic has been changed Breaking Change description for more information.

<dx:ASPxCaptcha ID="Captcha" runat="server" >
    <ValidationSettings EnableValidation="False"></ValidationSettings>
    <ClientSideEvents BeginCallback="onCaptchaBeginCallback" EndCallback="onCaptchaEndCallback" />
<label for="TbCode">Type the code</label>
<input type="text" id="TbCode" name="tbCode" autocomplete="off" />
<span id="ValidateCodeMessage" runat="server" enableviewstate="false"></span>

Online Demo

ASPxCaptcha - Custom Appearance

See Also