ASP.NET Core MaskedTextBox Setup

Shield UI MaskedTextBox for ASP.NET Core is a server-side wrapper component implemented as an ASP.NET Core MVC Helper.

For a detailed guide how to setup Shield UI for your ASP.NET Core project, check out this page.

The ASP.NET Core MVC helper API is a 1:1 mapping of the JavaScript MaskedTextBox widget configuration, so you only have to get familiar with a single set of configuration options:

// JavaScript Masked Textbox demo
$("#binary").shieldMaskedTextBox({
    enabled: true,
    mask: "00000000",
    rules: {
        '0': function (source) {
            //allow only 0 or 1 symbol
            return source === '0' || source === '1';
        }
    }
});
// ASP.NET Core Masked Textbox demo
@(Html.ShieldMaskedTextBox()
    .Name("binary")
    .Mask("00000000")
    .Value("00110101")
    .Rules(rb => rb
        .AddRule('0', @<text>
            function(source) { return source === '0' || source == '1' }
        </text>)
    )
)

To see the configuration options in action, please refer to our online demos.