ModelState.IsValid is always returning false in my edit form. It doesn't even hit the try catch. What am I doing wrong?
[AcceptVerbs("POST", "PUT")]
public ActionResult Edit(ItemModel model)
{
int customerID = model.customerID;
using (BusinessLogicLayer BLL = new BusinessLogicLayer())
{
if (ModelState.IsValid)
{
try
{
BLL.InsertData(model.customerID);
BLL.SaveChanges();
}
catch (Exception e)
{
return View();
}
}
}
return View();
}