[HttpPost] public ActionResult Edit(ClientViewModel model, FormCollection collection, Int32 id=0) { try { if (ModelState.IsValid) { Db.UpdateClient(model.Client); return this.Client(collection); } else foreach (ModelState state in ViewData.ModelState.Values.Where(x => x.Errors.Count > 0)) { var err = state; } return View(model); } catch { return View(model); } }So the problem now that IsValid returns false although I don't believe I break any rules. All I do is to add some address and then I click on Save button. The save has the following code:
Save: function () { if ($("#add-edit-form").valid()) { var urlLoc = '/Client/Edit/' + currentId; if ($('#fntype').val() === "Add") urlLoc = '/Client/Add'; var form = $('form', this); debugger; var oForm = form.serialize(); oForm = oForm.concat($('#frmClientsSearch').serialize()); $.ajax({ type: 'POST', url: urlLoc, data: oForm, dataType: 'json', cache: false, //contentType: 'application/json', success: function (result) { debugger; $('#flexClients').flexAddData(result); } }); $(this).dialog('close');So, why IsValid returns false and seems to be pointing to the Ext method validation, I have no idea :(