ASP.NET MVC - Custom Model Binder for ID fields
问题 i have the following entities: public class Category { public virtual int CategoryID { get; set; } [Required(ErrorMessage = "Section is required")] public virtual Section Section { get; set; } [Required(ErrorMessage = "Category Name is required")] public virtual string CategoryName { get; set; } } public class Section { public virtual int SectionID { get; set; } public virtual string SectionName { get; set; } } Now within my add category view i have a textbox to enter the SectionID eg: <%=