ActionLink without named query variables
I have an ActionLink that produces this URL
@Html.ActionLink("Hardware Profile", "Profile", "Device", new { id = 2, tab = "hardware"}, null)
//Produces: http://localhost:7946/Device/Profile/2?tab=hardware
But what I want it to produce is:
http://localhost:7946/Device/Profile/2/hardware
I have the following route setup
routes.MapRoute(
"DeviceProfile",
"device/profile/{id}/{tab}",
new { c开发者_如何学Goontroller = "Device", action = "Profile", id = UrlParameter.Optional, tab = UrlParameter.Optional }
);
How do I achieve this?
精彩评论