我正在尝试使用Html.ActionLink以这种形式生成链接:
/动作/型号/ ID /参数1 /参数2
我用过:
<%= Html.ActionLink("Link Text", "Action", "Model", new { id = var, parament1=var1 }, null) %>
但它总是看起来像/ Action / Model / Id?parameter1 = variable
我在Stackoverflow和其他地方看到过类似的问题,但我找不到一个有效/有意义的解决方案。任何帮助将不胜感激。
@John:我已注册以下路线:routes.MapRoute("Alternate","{controller}/{action}/{id}/{Heading}", new { controller = "Designation", action = "Details", id = "", Heading = "" }
I then have the following code in my view: <%= Html.ActionLink("Link Text", "Action", "Model", new { Id = model.Id, Heading = model.Heading }, null) %>
I get /Model/Action/Id?Heading=var1 I want it as /Model/Action/Id/var1
<%= Html.ActionLink("Link Text", "Action", "Model", new { Id = model.Id, Heading = model.Heading }, null) %>
答案 0 :(得分:0)