ActionLink指向不受当前路由影响的路由 [英] ActionLink pointing to route not affected by current route

查看:53
本文介绍了ActionLink指向不受当前路由影响的路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

将为我提供路线,但是如果我当前使用相同的动作和控制器,但具有更多的参数,这些参数也将包含在网址中.

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.

例如.如果我在页面上: http://localhost/MyWebsite/organizations/p001/departments/背心/员工/chn/MyController/MyAction

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

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

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

如我所愿.有什么建议吗?

as i would like. Any suggestions?

推荐答案

啊啊发现我可以改用RouteLink ...

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

这篇关于ActionLink指向不受当前路由影响的路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆