I need to change all the URLs in my MVC project, and thus far this has been quite simple - I've only had to change the URL string in all appropriate routes.MapRoute() in the global.asax.cs file.
One link in particular is acting stubborn and won't change, and I'm sure it's because it is the only one with parameters.
The mapRoute in question is:
routes.MapRoute(
"Mortgage.GetThisRate",
"mortgage-rates/mortgage-rate-details/{groupId}/{paymentType}/{mortgageValue}/{province}",
new { controller = "Mortgage", action = "GetThisRate", paymentType = UrlParameter.Optional, mortgageValue = UrlParameter.Optional, province = UrlParameter.Optional },
new { groupId = "\\d+", paymentType = "\\d+", mortgageValue = "\\d+", province = "\\d+" }
);
And the button calling this mapRoute is:
@Html.OmnitureButton( Url.Action("GetThisRate", new { groupId = info.GroupId }), "<span class=\"payment\"></span><br />Get Details", new {@class = "orange"}, "events", "event3", "", "event3", "", "Mortgage LearnMore")
When this button is pressed, the URL it requests is: http://www.apps.mysite.net/Mortgage/GetThisRate/8/48/200000/1 - completely ignoring the URL string in its mapRoute method, it would seem.
I've tried placing this mapRoute() at the top of global.asax.cs, to ensure it's not being ignored by a higher priority route, but the same problem persists.
Anybody knowledgeable in MVC routing able to puzzle out what's wrong here?