asp.net mvc Html.ActionLink() keeping route value I don't want

后端 未结 9 1869
我寻月下人不归
我寻月下人不归 2020-11-30 04:34

I have the following ActionLink in my view

<%= Html.ActionLink(\"LinkText\", \"Action\", \"Controller\"); %>

and it creates the follo

9条回答
  •  既然无缘
    2020-11-30 04:56

    Another way is to use ActionLink(HtmlHelper, String, String, RouteValueDictionary) overload, then there are no need to put null in the last parameter

    <%= Html.ActionLink("Details", "Details", "Product", new RouteValueDictionary(new { id=item.ID })) %>
    

提交回复
热议问题