2
Speak people, next: I’m trying to send one post
using the ko
, for a method ActionResult
of my controller instead of a JsonResult
as usual. When debugging the project it enters the ActionResult
but does not open the View which I am ordering. 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 just to take the data from model which come as a parameter to work with the same view EditarUsuario
I don’t need to return anything. It has to do this with the JsonResult
?
You want Ajax to transition the screen as well?
– Leonel Sanches da Silva
No no... Sent to Actionresult do not need to return anything via Json.
– Luciano Carlos