I am facing issue with validating List of controls using regular expression custom validator in asp.net MVC 2.0.
My code is below. This uses custom validator. But this is not working, any suggestion? This is assigning error to all the controls if any one control value is invalid.
[QuestionRegularExpression(@"\d{2}", ErrorMessage = "Must be numeric")]
public List<IDateQuestion> DriverViolationsList { get; private set; }
public ViolationDatesFormModel()
{
DriverViolationsList = new List<IDateQuestion>();
}
this didn’t work. Anyone please help. Thanks in advance.
you need to register the adapter on
Global.asax.cs