How to validate ViewModels derived from an abstract class?
问题 I have the following EditorTemplate @model ESG.Web.Models.FileInfo // <-- Changed to BaseFileInfo @{ ViewBag.Title = "FileInfoEditorTemplate"; } <fieldset> <table class="fileInfoEdit"> <tr> <td>Base Directory:</td> <td>@Html.EditorFor(model => model.Directory)</td> <td>@Html.ValidationMessageFor(model => model.Directory)</td> </tr> <tr> <td>Filename:</td> <td>@Html.EditorFor(model => model.Filename)</td> <td>@Html.ValidationMessageFor(model => model.Filename)</td> </tr> </table> </fieldset>