Currently I have a checkbox that looks like this
Adjust inventory levels <input type="checkbox" name="invChkBox" id="invChkBox" value="true" />
And my post controller method has parameters that look like this
public ActionResult EditItemInstance(int ID, string serialNumber, int ItemID, bool invChkBox)
but when the chkBox isn't checked it returns an error page. That has an error message saying
null entry for parameter 'invChkBox' of non-nullable type 'System.Boolean'
How can I edit my code so that it returns false if the checkbox is not clicked?
Aucun commentaire:
Enregistrer un commentaire