How to ignore current route values when generating links?

后端 未结 4 1014
挽巷
挽巷 2020-12-29 07:55

The question is similar to asp.net mvc Html.ActionLink() keeping route value I don't want, but with a twist that makes it more complex.

Starting from a default n

4条回答
  •  灰色年华
    2020-12-29 08:37

    I just tested this and it seems to work ok.

    Url.Action("Index", new { id = UrlParameter.Optional })
    

    generates

    /Home/Index
    

提交回复
热议问题