We are developing complex forms with many complex business rules such as "FieldY" should be required if FieldX is true and FieldZ is equal to 1 or 2.
From what I understand, validation should be applied on DTO's on the application layer and the cshtml should implement specific attribute on the HTML inputs to render the validation...However in the case of more complex validation rules I cannot figure out how to render the error per field on the view.
Currently the validation is displayed in a modal window after submission of my modal but I cannot show the validation error on the field itself (with a red border)
What are my options ? Should I add unobtrusive validation and create custom data annotation that implement the IClientValidatable? If so where should I place them to follow the best practices?
Thanks in advance