aspnet-devexpress-dot-web-c52e5e71.md
A control used for the challenge-response authentication.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class ASPxCaptcha :
ASPxWebControl,
IRequiresLoadPostDataControl
Public Class ASPxCaptcha
Inherits ASPxWebControl
Implements IRequiresLoadPostDataControl
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.
The ASPxCaptcha control is available on the DX.25.2: 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" />
</dx:ASPxCaptcha>
using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
ASPxCaptcha captcha = new ASPxCaptcha();
captcha.ID = "Captcha";
Page.Form.Controls.Add(captcha);
captcha.ClientInstanceName = "ClientCaptcha";
captcha.TextBox.Position = DevExpress.Web.Captcha.ControlPosition.Bottom;
captcha.ValidationSettings.SetFocusOnError = true;
captcha.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
}
Imports DevExpress.Web
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim captcha As ASPxCaptcha = New ASPxCaptcha()
captcha.ID = "Captcha"
Page.Form.Controls.Add(captcha)
captcha.ClientInstanceName = "ClientCaptcha"
captcha.TextBox.Position = DevExpress.Web.Captcha.ControlPosition.Bottom
captcha.ValidationSettings.SetFocusOnError = True
captcha.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText
End Sub
Note
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:
Note
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.
Show 14 items
Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxCaptcha MVCxCaptcha
See Also