Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Features

DisplayFormatString = "[ 00 - 00 - 00 ]"
NullText = "Enter your name..."
MaskSettings.Mask = "+1 (999) 000-0000"
[Mask("+1 (999) 000-0000")]


This demo illustrates the primary features of the DevExpress MVC Text Box - a single-line text input editor.

The text displayed in the edit box can be specified via the Text property. The Properties.DisplayFormatString property specifies the pattern used to format an editor's value for display purposes when not focused.

The Text Box editor supports masked input - mask settings can be accessed via the Properties.MaskSettings property. A mask expression can be specified via MaskSettings.Mask.

In addition to editor's mask settings, it is possible to define the mask settings for a model field using the DevExpress Mask attribute. The mask pattern will automatically be displayed within the TextBox extension. The Mask attribute enables the validation mechanism that checks whether the entered value matches the mask expression. The decorated model field will be automatically validated on the server side.

Collapse/Expand
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
The source code files for this demo are installed (by default) in the following directory:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxDataEditorsDemos