我有这个MaskedTextBox
:
<div style="direction:ltr;padding-left:20px;">
@(Html.Kendo().MaskedTextBox()
.Name("nationalityCode")
.Mask("000000000000").HtmlAttributes(new { @class = "login-input user-pass", width = "300px", placeholder = "Enter you code" })
)
</div>
我的问题是 NationalityCode 可以是 8 或 12 长度,如果我使用上面的代码,那么在运行时输入一个长度为 8 的代码,它会将 null 传递给控制器。