aspnet-devexpress-dot-web-8b55ba57.md
Contains mask settings.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class MaskSettings :
PropertiesBase
Public Class MaskSettings
Inherits PropertiesBase
The following members return MaskSettings objects:
The MaskSettings class contains the settings that allow you to specify the input mask, error text, prompt char, and to define whether the literal characters of the mask are included in an editor’s value.
These settings can be accessed via the MaskSettings property of editor controls.
<dx:ASPxTextBox ID="txtZip" runat="server">
<MaskSettings Mask="00000" PromptChar="#" />
</dx:ASPxTextBox>
<dx:ASPxTextBox ID="txtPhone" runat="server">
<MaskSettings Mask="+1 (999) 000-0000" IncludeLiterals="None" />
</dx:ASPxTextBox>
<dx:ASPxTextBox ID="txtPrice" runat="server" >
<MaskSettings Mask="$<0..99999g>.<00..99>" IncludeLiterals="DecimalSymbol" />
</dx:ASPxTextBox>
<dx:ASPxDateEdit ID="dateEdit" runat="server" EditFormat="Custom"
UseMaskBehavior="true" EditFormatString="MMMM dd, yyyy" >
</dx:ASPxDateEdit>
<dx:ASPxTextBox ID="txtPromoCode" runat="server" >
<MaskSettings ShowHints="true" Mask="<HOME|*BUSINESS>->aaaa-aaaa" />
</dx:ASPxTextBox>
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()
Object StateManager PropertiesBase MaskSettings
See Also