Kendo UI MaskedTextBox TagHelper MaskedTextBoxTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-maskedtextbox", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("maskedtextbox-editor", ParentTag = "form-item")]
[HtmlTargetElement("maskedtextbox-editor", ParentTag = "property-grid-item")]
[RestrictChildren("maskedtextbox-label", new string[] { "prefix-options", "suffix-options" })]
public class MaskedTextBoxTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IKendoFormEditor
Inheritance: objectTagHelperTagHelperBaseMaskedTextBoxTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-maskedtextbox name="phone_number" mask="(999) 000-0000" value="555 123 4567"></kendo-maskedtextbox>
Child Tags
Constructors
Initializes a new instance of the MaskedTextBoxTagHelper class.
public MaskedTextBoxTagHelper(IKendoHtmlGenerator generator)
Properties
Specifies whether the widget will replace the prompt characters with spaces on blur. Prompt chars will be shown again on focus (available since Q2 2014 SP1).
public bool? ClearPromptChar { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
An expression to be evaluated against the current model.
public ModelExpression For { get; set; }
Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.
public string InputMode { get; set; }
IsNested member.
[HtmlAttributeNotBound]
public bool IsNested { get; set; }
Implements:
Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
[HtmlAttributeName("label")]
public string LabelValue { get; set; }
Specifies the input mask. The following mask rules are supported: 0 - Digit. Accepts any digit between 0 and 9.; 9 - Digit or space. Accepts any digit between 0 and 9, plus space.; # - Digit or space. Like 9 rule, but allows also (+) and (-) signs.; L - Letter. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; ? - Letter or space. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; & - Character. Accepts any character. The rule is equivalent to \S in regular expressions.; C - Character or space. Accepts any character. The rule is equivalent to . in regular expressions.; A - Alphanumeric. Accepts letters and digits only.; a - Alphanumeric or space. Accepts letters, digits and space only.; . - Decimal placeholder. The decimal separator will be gotten from the current culture used by Kendo.; , - Thousands placeholder. The display character will be gotten from the current culture used by Kendo. or $ - Currency symbol. The display character will be gotten from the current culture used by Kendo..
public string Mask { get; set; }
The name of the JavaScript function that will handle the change event. Fires when the value is changed
public string OnChange { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the MaskedTextBox is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
Specifies the character used to represent the absence of user input in the widget
public string PromptChar { get; set; }
Defines an object of custom mask rules.
public IDictionary<string, string> Rules { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
Specifies whether the widget will unmask the input value on form post (available since Q1 2015).
public bool? UnmaskOnPost { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
TryAddAsEditor method.
public bool TryAddAsEditor(TagHelperContext context)
The result.
Implements:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: