I did not get this to work along the way, but to make this work with the QueryString parameter, as @Darin noted, here is the code:
@Html.ActionLink(product.Title, "Detail", "Products", new { id = product.ProductID }, "")
created actionLink as a request for me as follows: Products/Detail?id=PRODUCTID
my route at Global.asax.cs looked like this:
routes.MapRoute( "ProductDetail", "Products/Detail", new { controller = "Products", action = "Detail" } );
In my ProductController:
public ActionResult Detail(string id) { string identifier = HttpUtility.HtmlDecode(id); Store.GetDetails(identifier); return RedirectToAction("Index", "Home"); }
source share