Validate that a certain checkbox is checked before submit(ASP.NET MVC)
Introduction In this article we will discuss different approaches of performing validation on a checkbox value to be true in an MVC view.This validation should combine security and be user friendly as well Prepare Scenario 1.Create an MVC application as in the following pictures(name it ApproachForValidatingAcheckbox for example) 2.Add a new class under model folder as follows ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public class UserAgreementModel { } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 3.Add a controller class under controllers folder as follows 4.Add a view for submitting an instance of the model as follows place the following code in the view ////////////////////////////////////////////////////////////////////////////////////...