1
I have the following code:
function confirmaExclusao() {
var decisao = confirm("Deseja excluir permanentemente esse item?");
if(decisao == true)
{
//Chamar a action para excluir
}
else
{
//Aqui não vai fazer nada!
}
}
I need to call a ActionResult
of a Controller
in C# sending an argument, how can I do that?
Like a RedirectToAction
.
With the
RedirectToAction
doesn’t work? something likereturn RedirectToAction("TuaAcao", new { argumento = valor });
.– stderr
I haven’t been able to use Redirecttoaction in View, not even appears in auto complete.
– Jedaias Rodrigues
RedirectToAction
is a class methodApiController
- therefore, it is not available in the view. Also, even if it were available, it would be useless. The method returns an instance ofRedirectToRouteResult
, that has no meaning in the context of Javascript.– dcastro