I need to use @Url.Action to reach a MVC ASP.NET controller using the buton' click event and jQuery, so far this works for me
$("#btnEneviar").click(function (e) {
window.location.href = '@Url.Action(actionName: "TipoEvento", controllerName: "Home")';
});
but now I need to send a parameter to the controller using the route, this is my code
$("#btnEnviar").click(function (e)
{
var valorAccion = $('#Table tr:eq(0) td:eq(1)').text();
window.location.href = '@Url.Action("Solicitud", "Home", new { valor = valorAccion })';
});
but I got the error: "the name valorAccion does not exits in the current context"
could you please help me to fix it.