Is there a way to change the URL of a given action in mvc without changing the action or controller called?
If so, how would this be done on the following MapRoute:
routes.MapRoute(
"Estate.CloseDeal",
"Estate/CloseDeal/{groupId}/{paymentType}/{mortgageValue}/{province}",
new { controller = "Estate", action = "CloseDeal" },
new { groupId = "\\d+", paymentType = "\\d+", mortgageValue = "\\d+", province = "\\d+" }
);
The desired URL is: ".../estate-support/deal-closing/...". Currently it displays as ".../Estate/CloseDeal/..."
The button linking to this action looks like:
<button detail="@Url.Action("CloseDeal", new { groupId = info.GroupId })" class="orange">
EDIT 1:
Tried changing to:
routes.MapRoute(
"Estate.CloseDeal",
"estate-support/deal-closing/{groupId}/{paymentType}/{mortgageValue}/{province}",
new { controller = "Estate", action = "CloseDeal" },
new { groupId = "\\d+", paymentType = "\\d+", mortgageValue = "\\d+", province = "\\d+" }
);
This returned error: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Edit 2:
Changing the second string worked for all routes but this one - the difference being, this route has additional parameters (groupID, paymentType etc.).