Personal speech, following: I'm trying to send post
using ko
, to a ActionResult
method of my controller instead of a JsonResult
as usual. When debugging the project it goes into ActionResult
but does not open to View that I'm requesting. Could someone help me?
My ko:
self.Edita = function (usuario) {
self.usuario(usuario);
$.ajax({
url: '@Url.Action("EditarUsuario", "Administracao")',
cache: false,
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: ko.toJSON(usuario),
success: {}
});
};
My controller:
[HttpPost]
public ActionResult EditarUsuario(UsuarioViewModel usuarioViewModel)
{
return View();
}
My idea is actually to just get the data from the model that comes as a parameter to work with it in view EditarUsuario
I do not need to return anything. Can you do this with JsonResult
?