How do I stop URL.Action from including parameters?

前端 未结 2 1375
太阳男子
太阳男子 2021-01-17 22:08

In my main navigation I have a link to:

Url.Action(\"Items\", \"FAQ\");

The link works fine and I get to ~/Item/FAQ

However

相关标签:
2条回答
  • 2021-01-17 22:29

    I tried the answer but couldn't get it to work. In the end, I used a (comparatively) low tech solution:

    <a href="@Url.Content("~/Items/FAQ")">Nav Target Text</a>
    

    This ignores any id values set by visiting that same page.

    0 讨论(0)
  • 2021-01-17 22:32
    Url.Action("Items", "FAQ", new { WhateverYourRouteParameterIsCalled = "" })
    
    0 讨论(0)
提交回复
热议问题