CaptchaValidationSettings.ErrorDisplayMode Property
Gets or sets a value that specifies how an error message is represented within the editor’s error frame.
Namespace: DevExpress.Web.Captcha
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
[DefaultValue(ErrorDisplayMode.Text)]
public ErrorDisplayMode ErrorDisplayMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
ErrorDisplayMode | Text | One of the ErrorDisplayMode enumeration values. |
Available values:
Name | Description |
---|---|
Text | An error message is represented by text only. |
ImageWithTooltip | An error message is represented by an error image. The image’s tooltip displays an error text. If an assigned error image is incorrect, an error message is represented by an error text directly. |
ImageWithText | An error message is represented by both an error image and error text. |
None | No error message is displayed, a specific error frame is displayed near the editor instead. |
Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to ErrorDisplayMode |
---|---|---|
ASP.NET Web Forms Controls | ASPxCaptcha |
|
ASP.NET MVC Extensions | CaptchaSettings |
|
Remarks
The default value of this property depends upon whether an editor is used as standalone or as inplace (within, for example, the ASPxGridView). For a standalone editor, the ErrorDisplayMode property’s default value is ErrorDisplayMode.ImageWithText. For an inplace editor, the default value is ErrorDisplayMode.ImageWithTooltip.
Example
The following part of the ASPxCaptcha - Features online demo illustrates how to customize the challenge image‘s style settings.
These settings are specified within a panel (ASPxComboBox, ASPxColorEdit editors) and applied to the captcha control via the Apply button (ASPxButton).
protected void btnApply_Click(object sender, EventArgs e) {
...
int parseResult = 0;
Captcha.ChallengeImage.FontFamily = cbFontFamily.Value.ToString();
Captcha.ChallengeImage.ForegroundColor = ceForegroundColor.Color;
Captcha.ChallengeImage.BackgroundColor = ceBackgroundColor.Color;
Captcha.ChallengeImage.BorderColor = ceBorderColor.Color;
if (int.TryParse(seBorderWidth.Text, out parseResult))
Captcha.ChallengeImage.BorderWidth = parseResult;
...
}