New to Telerik UI for ASP.NET MVC? Download free 30-day trial

MaskedTextBoxRulesBuilder

Methods

Add(System.Char,System.String)

Adds a custom mask rule.

Parameters

name - System.Char

The name of the rule.

regexp - System.String

The JavaScript RegExp object assigned to defined rule.

Example


             @(Html.Kendo().MaskedTextBox()
                 .Name("maskedTextBox")
                 .Rules(rules =>
                     rules.Add('~', "/[+-]/")
                  )
             )

Add(System.Char,System.Func)

Adds a custom mask rule.

Parameters

name - System.Char

The name of the rule.

handler - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


             @(Html.Kendo().MaskedTextBox()
                 .Name("maskedTextBox")
                 .Rules(rules =>
                 {
                   rules.Add('^', @<text>
                      function(char) {
                        return char === "^";
                      }
                      </text>);
                  })
             )

In this article
Not finding the help you need?