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

后端 未结 9 1859
我寻月下人不归
我寻月下人不归 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 05:21

    The problem is the built in methods take input from the URL you are currently on as well as what you supply. You could try this:

    <%= Html.ActionLink("LinkText", "Action", "Controller", new { id = ""}) %>
    

    That should manually wipe the id parameter.

提交回复
热议问题