Mark Tabor

Mark Tabor

  • 586
  • 2k
  • 464.4k

CheckboxFor in MVC using Razor view

Sep 25 2019 12:20 AM
Hi I am creating Dynamic Forms in which i have textboxes and checkboxes as well , i was using html input type for checkbox but it is not getting value and while submitting the form it says that your checkbox column like Active column does not have a valid value i found on internet and find that i need to use @html.checkboxFor rather than html tags so how do i write the below line with html.checkboxfor 
<input type="checkbox" id="educations[0].IsActive" name="educations[0].IsActive" class="css-checkbox9 all_check" />
as i have educatuons[0].isActive as the model item is an array  

Answers (5)