Class MaskedTextBox
Inheritance
System.Object
MaskedTextBox
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Syncfusion.EJ2.dll
Syntax
public class MaskedTextBox : EJTagHelper
Constructors
MaskedTextBox()
Declaration
Properties
Blur
Triggers when the MaskedTextBox got focus out.
Declaration
[HtmlAttributeName("blur")]
public string Blur { get; set; }
Property Value
Type |
Description |
System.String |
|
Change
Triggers when the value of the MaskedTextBox changes.
Declaration
[HtmlAttributeName("change")]
public string Change { get; set; }
Property Value
Type |
Description |
System.String |
|
ClassName
Declaration
protected override string ClassName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Created
Triggers when the MaskedTextBox component is created.
Declaration
[HtmlAttributeName("created")]
public string Created { get; set; }
Property Value
Type |
Description |
System.String |
|
CssClass
Gets or sets the CSS classes to root element of the MaskedTextBox which helps to customize the
complete UI styles for the MaskedTextBox component.
Declaration
[HtmlAttributeName("cssClass")]
public string CssClass { get; set; }
Property Value
Type |
Description |
System.String |
|
CustomCharacters
Sets the collection of values to be mapped for non-mask elements(literals)
which have been set in the mask of MaskedTextBox.
In the below example, non-mask elements "P" accepts values
"P" , "A" , "p" , "a" and "M" accepts values "M", "m" mentioned in the custom characters collection.
For more information on customCharacters, refer to
customCharacters.
{% codeBlock src='maskedtextbox/customCharacters/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("customCharacters")]
public object CustomCharacters { get; set; }
Property Value
Type |
Description |
System.Object |
|
Destroyed
Triggers when the MaskedTextBox component is destroyed.
Declaration
[HtmlAttributeName("destroyed")]
public string Destroyed { get; set; }
Property Value
Type |
Description |
System.String |
|
Enabled
Sets a value that enables or disables the MaskedTextBox component.
Declaration
[HtmlAttributeName("enabled")]
public bool Enabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnablePersistence
Sets a value that enables or disables the persisting state of the MaskedTextBox after reloading the page.
If enabled, the 'value' state will be persisted.
Declaration
[HtmlAttributeName("enablePersistence")]
public bool EnablePersistence { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
[HtmlAttributeName("enableRtl")]
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
FloatLabelType
The acts as a label
and floats above the MaskedTextBox based on the below values.
Possible values are:
Never - The floating label will not be enable when the placeholder is available.
Always - The floating label always floats above the MaskedTextBox.
Auto - The floating label floats above the MaskedTextBox after focusing it or when enters the value in it.
Declaration
[HtmlAttributeName("floatLabelType")]
public FloatLabelType FloatLabelType { get; set; }
Property Value
Focus
Triggers when the MaskedTextBox got focus in.
Declaration
[HtmlAttributeName("focus")]
public string Focus { get; set; }
Property Value
Type |
Description |
System.String |
|
HtmlAttributes
You can add the additional html attributes such as disabled, value etc., to the element.
If you configured both property and equivalent html attribute then the component considers the property value.
{% codeBlock src='maskedtextbox/htmlAttributes/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("htmlAttributes")]
public object HtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Object |
|
IsFor
Declaration
protected override bool IsFor { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
[HtmlAttributeName("locale")]
public string Locale { get; set; }
Property Value
Type |
Description |
System.String |
|
Mask
Sets a value that masks the MaskedTextBox to allow/validate the user input.
Mask allows standard mask elements
as mask
elements.
For more information on mask, refer to
mask.
If the mask value is empty, the MaskedTextBox will behave as an input element with text type.
Declaration
[HtmlAttributeName("mask")]
public string Mask { get; set; }
Property Value
Type |
Description |
System.String |
|
NameSpace
Declaration
protected override string NameSpace { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Placeholder
Gets or sets the string shown as a hint/placeholder when the MaskedTextBox is empty.
It acts as a label and floats above the MaskedTextBox based on the
Declaration
[HtmlAttributeName("placeholder")]
public string Placeholder { get; set; }
Property Value
Type |
Description |
System.String |
|
PromptChar
Gets or sets a value that will be shown as a prompting symbol for the masked value.
The symbol used to show input positions in the MaskedTextBox.
For more information on prompt-character, refer to
prompt-character.
Declaration
[HtmlAttributeName("promptChar")]
public string PromptChar { get; set; }
Property Value
Type |
Description |
System.String |
|
Readonly
Specifies the boolean value whether the Masked TextBox allows the user to change the text.
Declaration
[HtmlAttributeName("readonly")]
public bool Readonly { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ShowClearButton
Specifies whether to show or hide the clear icon.
Declaration
[HtmlAttributeName("showClearButton")]
public bool ShowClearButton { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
TagName
Declaration
protected override string TagName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Value
Gets or sets the value of the MaskedTextBox. It is a raw value of the MaskedTextBox excluding literals
and prompt characters. By using getMaskedValue
property, you can get the value of MaskedTextBox with the masked format.
{% codeBlock src='maskedtextbox/value/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("value")]
public string Value { get; set; }
Property Value
Type |
Description |
System.String |
|
Width
Sets the width of the MaskedTextBox.
Declaration
[HtmlAttributeName("width")]
public string Width { get; set; }
Property Value
Type |
Description |
System.String |
|