public ActionResult Create(FormCollection collection) { try { if (ModelState.IsValid) { ModelAluno aluno = new ModelAluno(); aluno.Nome = collection["Nome"].ToString(); aluno.DataNascimento = Convert.ToDateTime(collection["DataNascimento"]); aluno.RG = collection["RG"].ToString(); aluno.CPF = collection["CPF"].ToString(); aluno.Salvar(); } return Json(new { Message = "Sucesso.", IsErro = false }); } catch (Exception ex) { return Json(new { Message = "Erro: " + ex.Message, IsErro = true }); } }