Why does the following Html.ActionLink
call:
Html.ActionLink("Approve", "Advance", new { id = Model.ID, step = StepType.Approve })
generate a URL with query parameters rather than a "restful" URL, i.e.:
http://localhost/Website/Case/Advance/1?step=Refer
I only have the default route registered, do I need additional routes that can understand what the "StepType" parameter is?
I've tried adding this route in after the default route:
routes.MapRoute(
"CaseAdvance",
"{controller}/{action}/{id}/{step}",
new {controller = "Case", action = "Advance", id = "", step = StepType.Refer});
but it had no effect. Adding the new route registration before the default gave me an error:
The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int64' for method 'System.Web.Mvc.ActionResult Advance(Int64, Website.Core.StepType)' in 'Website.Controllers.CaseController'. To make a parameter optional its type should be either a reference type or a Nullable type.