ActionLink pointing to route not affected by current route

╄→尐↘猪︶ㄣ 提交于 2019-12-25 01:13:13

问题


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.

Eg. if I am on the page: 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

as i would like. Any suggestions?


回答1:


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



来源:https://stackoverflow.com/questions/697210/actionlink-pointing-to-route-not-affected-by-current-route

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!