public ActionResult SaveCliente(String data) { Dictionary <String, Object> response = new Dictionary <String, Object>(); Dictionary <String, Object> datos = new Dictionary <String, Object>(); var result = new JavaScriptSerializer().Deserialize <dynamic>(data); foreach (var obj in result) { datos.Add(obj["name"], obj["value"]); } int resp = Paquetes.InsertCliente(datos); if (resp != 0) { response.Add("success", "true"); response.Add("IdCliente", resp); } else { response.Add("error", "No se ha podido guardar el cliente."); } return(Json(response, JsonRequestBehavior.AllowGet)); }