Skip to main content
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.v24.1.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:

Object Type Path to ErrorText
ASPxButtonEdit
.MaskSettings .ErrorText
ASPxTextBox
.MaskSettings .ErrorText
ButtonEditProperties
.MaskSettings .ErrorText
TextBoxProperties
.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