ActionLink指向不受当前路线影响的路线

时间:2021-02-12 11:26:00

I have am problem because I have a menu where the links always should point to MyController/MyAction, but the site has other routes that go to the same action, but with more parameters.

我有问题,因为我有一个菜单,其中链接始终应指向MyController / MyAction,但该网站有其他路由转到相同的操作,但有更多的参数。

Will give me the route but if I am currently on the same action and controller, but with more params these are included in the url as well.

将给我路线,但如果我目前在同一个动作和控制器,但有更多的参数,这些也包括在网址中。

Eg. if I am on the page: http://localhost/MyWebsite/organizations/p001/departments/vest/employees/chn/MyController/MyAction

例如。如果我在页面上:http:// localhost / MyWebsite / organizations / p001 / departments / vest / employees / chn / MyController / MyAction

the url generated will be the same as above and not: http://localhost/MyWebsite/MyController/MyAction

生成的url将与上面相同而不是:http:// localhost / MyWebsite / MyController / MyAction

as i would like. Any suggestions?

正如我所愿。有什么建议?

1 个解决方案

#1


Ahh found out that I could use RouteLink instead...

啊,发现我可以使用RouteLink代替......

#1


Ahh found out that I could use RouteLink instead...

啊,发现我可以使用RouteLink代替......