If one of the fields in the Model is bound to a EditorTemplate, will the javascript unobtrusive data-val-* parameters be generated for the EditorTemplate if the field in the Model is decorated with validation attributes.
Also, if I apply a custom client validation, by implementing a validation attribute with IClientValidatable, and decorate this field with that custom attribute, does it generate the data-val-* attributes for the EditorTemplate in the client side, for the client rules I add in the custom validaiton attribute?
I don't seem to get it working, it does not emit the client side attributes for me.
开发者_如何学编程This is a simpler and part of my previous post
Got it working. Thanks to Brad Wilson on other forum, actually if we have any input control in it, for which a validation can be applied, it is generating data-val-* attributes. I was checking in some other scenario, it was not working for me, but a normal simple case is generating those attributes.
精彩评论