MaskSettings Class
In This Article
Contains mask settings.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public class MaskSettings :
PropertiesBase
#Related API Members
The following members return MaskSettings objects:
#Remarks
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.
#Example
- Zip code
html
<dx:ASPxTextBox ID="txtZip" runat="server">
<MaskSettings Mask="00000" PromptChar="#" />
</dx:ASPxTextBox>
- Phone Number
html
<dx:ASPxTextBox ID="txtPhone" runat="server">
<MaskSettings Mask="+1 (999) 000-0000" IncludeLiterals="None" />
</dx:ASPxTextBox>
- Price
html
<dx:ASPxTextBox ID="txtPrice" runat="server" >
<MaskSettings Mask="$<0..99999g>.<00..99>" IncludeLiterals="DecimalSymbol" />
</dx:ASPxTextBox>
- Date
html
<dx:ASPxDateEdit ID="dateEdit" runat="server" EditFormat="Custom"
UseMaskBehavior="true" EditFormatString="MMMM dd, yyyy" >
</dx:ASPxDateEdit>
- Promo Code
html
<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()
#Concepts
#Online Demos
#Implements
#Inheritance
Object
StateManager
PropertiesBase
MaskSettings
See Also