Reputation: 23935
I would like to direct the following URL:
http://myweburl/Wheel/466/Direction/903/Highlight/7
To a controller action:
public ActionResult Index(int wheel, int direction, int highlight)
On the controller VehicleController
I still want to keep my Home/Index as the root url of the site. So if someone entered
http://myweburl/
They would be directed to Home/Index
How do I do this?
Upvotes: 1
Views: 105
Reputation: 23935
Just add the follwing as a route above the default route (Home/Index)
routes.MapRoute(
name: "WheelRoute",
url: "Wheel/{wheel}/Direction/{direction}/Highlight/{highlight}",
defaults: new { controller = "VehicleController", action = "Index" }
);
Upvotes: 2