I'm having this strange routing problem - I have 2 kinds of routes to the same view. Such as Simulator/RunStrategy/7 and Simulator/RunStrategy/7/1000.
Where as the controller and view is defined as public ActionResult RunStrategy(int id, decimal sum).
When I use the short one I see the view as needed, when i use the long one - I get all the "link href...." messed up. Such as:
<link href="../../../css/global.css" rel="stylesheet" type="text/css" />
Where it should be:
<link href="../../css/global.css" rel="stylesheet" type="text/css" />
Which really is displayed correctly when I use the short routing link.
The routing table is as follows:
routes.MapRoute(
"Run Simulation",
"Simulator/RunStrategy/{id}/{startingsum}",
new { controller = "Simulator", action = "RunStrategy", id = "0", startingsum = "100000" },
new { id = @"\d+", startingsum = @"^([0-9]*|\d*\.\d{1}?\d*)$" }
);
Where it works fine.
Help would be much appreciated. Thanks.