How to use the jQuery validate plugin with strongly typed enumerations?
问题 I am using a strongly typed view that lists an enumeration of objects, something like this: @model IEnumerable<Foo> <table> <tbody> @Html.EditorForModel() </tbody> </table> Let's say Foo has a simple numeric property that I want to validate on the client side: public class Foo { [Required] public int Bar { get; set; } } Now the editor template for this object looks like this: @model Foo <tr> <td>@Html.TextBoxFor(m => m.Bar)</td> </tr> This works fine, except that the default model binder