First html helper generates client-side validation attributes, while the second one doesn’t

The CheckBox() helper does not render thedata-val attributes because the form has already rendered CheckBoxFor() for the same property. If you swap the order, the data-val attributes would be rendered for CheckBox() (and not for CheckBoxFor()). My understanding is this would cause a potential (duplication) problem with jquery.validation.unobtrusive when parsing the form. The html helpers … Read more

What is Unobtrusive Javascript in layman terms? [closed]

Checkout the wikipedia article: Unobtrusive JavaScript “Unobtrusive JavaScript” is a general approach to the use of JavaScript in web pages. Though the term is not formally defined, its basic principles are generally understood to include: Separation of functionality (the “behavior layer”) from a Web page’s structure/content and presentation Best practices to avoid the problems of … Read more