I have an action result that I want to redirect to an action with a dynamic ID.
return RedirectToAction("Engine", new {id = latestVersion.Id});
However, the URL that returns ends up being:
domain.com/project/engine/xxx
what I need however is it to be:
domain.com/project/engine?id=xxx
Here are my current maproutes:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"PrevSession", // Route name
"{controller}/{action}/{id}/{id2}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional, id2 = UrlParameter.Optional } // Parameter defaults
);
Is there a way to change the way this is formatted at the controller level?