Though I am not sure if the following sample code answer your exact problem but it perfectly works for array item length validation using DataAnnotations attribute:
Model
Imports System.ComponentModel.DataAnnotations
Public Class MyCustomObjectWithArray
<MinLength(4, ErrorMessage:="Minimum four Employees should be submitted.")>
Public Property EmployeeArray() As Employee()
End Class
Public Class Employee
Public Property Name() As String
Public Property City() As String
End Class
Controller
Public Class HomeController
Inherits System.Web.Mvc.Controller
Function Index() As ActionResult
Dim customObject As MyCustomObjectWithArray = New MyCustomObjectWithArray()
customObject.EmployeeArray = New Employee() {}
'Fill the employee array to have only 3 elements so that
' validation fail on form post since Employee array has validation for at least 4 employee names.
For empIndex = 0 To 2
ReDim Preserve customObject.EmployeeArray(empIndex)
customObject.EmployeeArray(empIndex) = New Employee()
Next
Return View("CreateEmployees", customObject)
End Function
<HttpPost>
Function CreateEmployees(ByVal objWithArray As MyCustomObjectWithArray) As ActionResult
If (Not ModelState.IsValid) Then 'Make sure modelstate validation errors are not bypassed.
Return View("CreateEmployees", objWithArray)
End If
'Do stuff like saving to DB or whatever you want with the valid Posted data.
Return RedirectToAction("Index", "Home")
End Function
End Class
View
@ModelType MvcVBApplication.MyCustomObjectWithArray
@Code
ViewData("Title") = "CreateEmployees"
End Code
<h3>CreateEmployees<h3>
@Using (Html.BeginForm("CreateEmployees", "Home"))
Html.EnableClientValidation(True)
@<table>
@If (Model.EmployeeArray IsNot Nothing) Then
For empIndex = 0 To Model.EmployeeArray.Count() - 1
@<tr>
<td>
@Html.TextBoxFor(Function(modelItem) Model.EmployeeArray(empIndex).Name)
</td>
</tr>
Next
Else
@Html.TextBox("(0).Name", "")
End If
</table>
@Html.ValidationMessageFor(Function(m) m.EmployeeArray)
@<br />
@<input type="submit" name="name" value="Submit" />
End Using
Hope this helps. I am not much into VB.NET so you may choose appropriate code constructs if you find the one I use seem to be in old way.