Hello, I am using a @Html.Actionlink(..) callo to redirect my page to a specific action in a controller .
My call is the following :
@Html.ActionLink(P.Cert, "RedirectToRate","Panels", new { @sede = P.Sed1 + P.Sed2, @catg = P.Catg, @cert = P.Cert, @anno = P.AnnoValidita }, new { @style = "background-color : white ;width :70% " })
I can see that it's rendered as :
<a href="/Panels/RedirectToRate?sede=0100&catg=885&cert=01030580" style="background-color : white ;width :70% ">01030580</a>
which is what I want.
in the "Panels" controller I have the "RedirectToRate" action whose contract is as follows :
ActionResult RedirectToRate(string sede="", string catg="", string cert="", string anno="")
my route maps are the following
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Access",
url: "{controller}/{action}/{pensione}/{sede}/{catg}/{cert}/{anno}",
defaults: new { controller = "Home", action = "Index", sede = UrlParameter.Optional, catg = UrlParameter.Optional, cert = UrlParameter.Optional, anno = UrlParameter.Optional }
);
When I click the link, I have a runtime error, I don't know how and where, so that i am not able to catch it .... any idea why ?
thanks
What I have tried:
changing route mapping
reversing Controller/Action order in the actionlink call