Validation MVC验证属性剑道网格don';我不能和你一起工作

Validation MVC验证属性剑道网格don';我不能和你一起工作,validation,kendo-grid,kendo-asp.net-mvc,Validation,Kendo Grid,Kendo Asp.net Mvc,在我的模型中,我有 [Required(ErrorMessage = "BIC Code is required")] [RegularExpression("^[a-zA-Z0-9]{11}$",ErrorMessage = "11 alphanumeric characters expected")] [UIHint("BicCode")] public string BicCode { get; set; } 与BIC代码对应的模板 @model str

在我的模型中,我有

    [Required(ErrorMessage = "BIC Code is required")]
    [RegularExpression("^[a-zA-Z0-9]{11}$",ErrorMessage = "11 alphanumeric characters expected")]
    [UIHint("BicCode")]
    public string BicCode { get; set; } 
与BIC代码对应的模板

@model string  
@(Html.Kendo().MaskedTextBox().Name("BicCode").Mask("AAAAAAAAAAA") )
在我的剑道网格版本中,除了使用UIHint的属性外,所有的验证属性都会被使用


如何处理UIHint验证和剑道网格?

正如Steve Greene在评论中建议的那样


使用
MaskedTextBox for(m=>m)
而不仅仅是
MaskedTextBox()
解决了我的问题。

你的模板在视图->共享->编辑模板中吗?@SteveGreene是的,我的模板是可以的,因为当我在网格的一行上按edit时,会显示MaskedTextBox,只是客户端没有管理验证。我想你的问题可能是剑道如何呈现屏蔽文本框。我假设验证属性不存在。您可以尝试将模板更改为MaskedTextBoxFor(m=>m),正如@SteveGreene Thanke You所建议的那样