Client-side validation with non-model view in ASP.NET MVC 2

I would like to use the new client-side validation features in MVC 2, but I have a specific view that has only a few text fields, and I don't want to create a strongly typed model for it. Can anyone describe how to use validity in MVC 2 without a strongly typed model?

+3
source share
1 answer

I don't think this can be done, as client-side validation uses data annotations in the System.ComponentModel.DataAnnotations namespace. As far as I know, you should bind this to an object. I would suggest looking at a jquery solution.

+2
source

Source: https://habr.com/ru/post/1739912/


All Articles