ActionLink pointing to route not affected by curre

2019-08-21 20:08发布

问题:

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...