I’m an MVC/jQuery noobie and this one really got my goat for while. The problem was handling the bit field in SQL Server which was treated as a checkbox field in MVC. Here’s how you can set a checkbox value based the the user’s selection from dropdown list on the same view: Model: public string Field_Ref_Name { get; set; } // the dropdown list public bool CoreField { get; set; } // the checkbox Controller: From the Get ActionResult method to populate the dropdown list. ViewBag.projectConditionWit... ......
When a table name uses a reserved word: for example, “Action,” model validation will fail even though the model is valid. The error message from ModelState is: “The parameter conversion from type 'System.String' to… …type failed because no type converter can convert between these types.” For example, if a table named Action has a related table, Action_Details, where an Action may have one to many Action_Conditions, you may have a model class for Action_Details that looks like this: public class Action_Details ......