Model binding works perfectly fine, so I do see that the name 'DepartmentList[0].Name' in the input field maps correctly to the collection property in the Employee object in the controller and then I thought same way my validations will work but they don't
get fired at all
kunal1982
Member
42 Points
52 Posts
Re: How to apply validation to a collection item in Asp.net MVC 2
May 04, 2012 08:20 PM|LINK
Yes that is already done, but client side validation fails to run...
Also, my Markup for the input field and the associated validation is like this :
<input type='text' class='input-choice' id='txtChoice0' name='DepartmentList[0].Name' /> <%=Html.ValidationMessage("DepartmentList[0].Name") %>
Model binding works perfectly fine, so I do see that the name 'DepartmentList[0].Name' in the input field maps correctly to the collection property in the Employee object in the controller and then I thought same way my validations will work but they don't get fired at all
Kunal Uppal
Software Engineer,
ICS, Mumbai