title: How to add boolean required attribute in mvc?
body: <p>I have one model class like:</p>
  
  <pre><code>public class Student
  {
      [DataType(DataType.Date)]
      [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
      [Display(Name = "Enrollment Date")]
      public DateTime EnrollmentDate { get; set; }
  
      [Required]
      [Display(Name = "Is Active")]
      public bool IsActive { get; set; }
  
      public virtual ICollection&lt;Enrollment&gt; Enrollments { get; set; }
  }
  </code></pre>
  
  <p>Here I have created a <code>Boolean</code> property <code>IsActive</code> with <code>Required</code> attribute, but the problem is that my view is not executing the required validation for this property? I want to bind this property with a <code>CheckBox</code> and check if this <code>CheckBox</code> is checked and run validation if it is not.</p>
  
  <p>Any solution for this?</p>