Skip to main content
A newer version of this page is available. .
Tab

MaskSettings.ErrorText Property

Gets or sets the error text to be displayed, if user input is not valid against the specified mask.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue("")]
public string ErrorText { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that specifies the error text.

Property Paths

You can access this nested property as listed below:

Show 15 property paths
Library Object Type Path to ErrorText
ASP.NET Controls and MVC Extensions ASPxButtonEdit
.MaskSettings .ErrorText
ASPxTextBox
.MaskSettings .ErrorText
ButtonEditProperties
.MaskSettings .ErrorText
RibbonTextBoxProperties
.MaskSettings .ErrorText
TextBoxProperties
.MaskSettings .ErrorText
ASP.NET Bootstrap Controls BootstrapButtonEdit
.MaskSettings .ErrorText
BootstrapButtonEditProperties
.MaskSettings .ErrorText
BootstrapTextBox
.MaskSettings .ErrorText
BootstrapTextBoxProperties
.MaskSettings .ErrorText
ASP.NET MVC Extensions MVCxButtonEdit
.MaskSettings .ErrorText
MVCxButtonEditProperties
.MaskSettings .ErrorText
MVCxColumnButtonEditProperties
.MaskSettings .ErrorText
MVCxColumnTextBoxProperties
.MaskSettings .ErrorText
MVCxTextBox
.MaskSettings .ErrorText
MVCxTextBoxProperties
.MaskSettings .ErrorText

Remarks

If a mask specified via the MaskSettings.Mask property contains strict parts (such as “0”) restricting user input, specific validation of the entered value against the specified mask is performed on submitting the value. You can use the ErrorText property to define an explanatory text to be displayed when this mask-specific validation fails.

The error text can be displayed either within an editor’s error frame, or within an error image’s tooltip. This behavior is defined by settings available via an editor’s ASPxEdit.ValidationSettings property (in particular, by the ValidationSettings.ErrorDisplayMode property).

Example

MVC:

@Html.DevExpress().TextBox(settings => {
    settings.Name = "textBox3";
    settings.Width = Unit.Percentage(100);
    settings.Properties.MaskSettings.Mask = "+1 (999) 000-0000";
    settings.Properties.MaskSettings.IncludeLiterals = MaskIncludeLiteralsMode.None;
    settings.Properties.MaskSettings.ErrorText = "Invalid Phone Number";
    settings.Properties.ValidationSettings.Display = Display.Dynamic;
}).GetHtml()

Concepts

Online Demos

See Also