asp.net mvc - MVC Checkbox not checked when value is true -
i have grid of records contain check box. check box indicates whether transaction has been acknowledged or not. testing purposes, added display text next check box , text indicates boolean true. however, check box not checked.
@for (int = 0; < model.transactionlist.count; i++) { <tr> <td class="hidden"> @html.hiddenfor(m => m.transactionlist[i].providertransactionid)</td> <td class="text-center"> @html.displaytextfor(m => m.transactionlist[i].acknowledged) @html.checkboxfor(m => m.transactionlist[i].acknowledged) @html.hiddenfor(m=>m.transactionlist[i].acknowledged) </td> <td> @html.displayfor(m => m.transactionlist[i].fromuictxt) @html.hiddenfor(m => m.transactionlist[i].fromuictxt) </td> <td> @html.displayfor(m => m.transactionlist[i].touictxt) @html.hiddenfor(m => m.transactionlist[i].touictxt) </td> <td> @html.displayfor(m => m.transactionlist[i].primaryuictxt) @html.hiddenfor(m => m.transactionlist[i].primaryuictxt) </td> <td> @html.displayfor(m => m.transactionlist[i].action) @html.hiddenfor(m => m.transactionlist[i].action) </td> <td> @html.displayfor(m => m.transactionlist[i].initiateddatestring) @html.hiddenfor(m => m.transactionlist[i].initiateddatestring) </td> <td> @html.displayfor(m => m.transactionlist[i].providerfirst) @html.displayfor(m => m.transactionlist[i].providerlast) @html.hiddenfor(m => m.transactionlist[i].providerfirst) @html.hiddenfor(m => m.transactionlist[i].providerlast) </td> <td> @html.displayfor(m => m.transactionlist[i].ssn) @html.hiddenfor(m => m.transactionlist[i].ssn) </td> <td> @html.displayfor(m => m.transactionlist[i].sendersfirst) @html.displayfor(m => m.transactionlist[i].senderslast) @html.hiddenfor(m => m.transactionlist[i].sendersfirst)@html.hiddenfor(m => m.transactionlist[i].senderslast) </td> <td> @html.displayfor(m => m.transactionlist[i].sendersphone) @html.hiddenfor(m => m.transactionlist[i].sendersphone) </td> </tr> }
thanks!
try clearing modelstate. modelstate.clear()
. way checkbox helper value model , not modelstate, might have conflict property name.
Comments
Post a Comment