I'm trying to make it use a ActionLink
with multiple parameters to generate a link to me in the form
{Controller}/{Action}/{idCompania}/{idLocal}/{fecha}
But it always generates a querystring :
{Controller}/{Action}?idCompania=0&idLocal=21&fecha=23-12-2015
In the global.asax
I have:
routes.MapRoute(
"UltimosInformesDetail",
"UltimosInformes/Details/{idCompania}/{idLocal}/{fecha}",
new { controller = "UltimosInformes",
action = "Details",
idCompania="",
idLocal="",
fecha="" },
null
)
My ActionLink
in the view:
<td>
@Html.ActionLink("Detalle",
"Details",
"UltimosInformes",
new { idCompania = item.Compania,
idLocal = item.Local.Codigo,
fecha = item.Fecha.ToString("dd-MM-yyyy")}, null)
</td>
My controller
:
public ActionResult Details(short idCompania, short idLocal,string fecha)
{
var s = RootContext.Instance.Resolve<ProblemaService>();
return View(s.ObtenerAuditoresVisita(idCompania, idLocal, DateTime.Parse(fecha)));
}
I researched in SO in English see here and here But I could not solve it
I can not make it generate the "routed" link, it always generates a querystring