MVC : Checkboxes generated using JavaScript not appearing in FormCollection on postback
- by Andy Evans
I took over another project (written by one contractor, modified by another and now it's not working) written using MVC/C# where a view that has a table (see below) is dynamically populated using JSON/Javascript - the first column of which is a checkbox.
View (spark view engine)
<table id='component_list' name='component_list' cellpadding='0' border='0' cellspacing='0'>
<thead>
<tr>
<th> </th>
<th>Component</th>
<th>Component Type</th>
<th>Evenflo Part #</th>
<th>Supplier Part #</th>
<th>Supplier</th>
<th>Requirement</th>
<th>Location</th>
<th>Region</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
When the page is rendered, I look at the source for the page and do not see the table data (I wouldn't expect to see this). However, when the form is posted back, controller, the FormCollection is empty. Supposedly this had been working before the last contractor got their hands on it - which is another post all together. My goal right now is having the checkboxes in the FormCollection.
Any suggestions would be greatly appreciated.
Thanks,