views:

17

answers:

0

I have a ascx file (with its own viewmodel) that displays a table. Each row in the table will have a user control (with their own ViewModel - created from the ascx viewmodel). The main problem is with validation.

The individual user controls on each row use DataAnnotation validation with a Validation summary at the top of it, when running the code, the validation behaves oddly.

  1. Using [DataType(DataType.DateTime)] I expect it to show an error if the user tries to enter letters - and it doesnt.

  2. The validation summary and validation messages dont show next to the control that is being validated. Lets say the user control in the 3rd row of the table is invalid, the asterixs and summary display next to the control in the 1st row.

Anyone got any clues?