Asp.Net MVC: How do I get virtual url for the current controller/view?

前端 未结 5 2001
谎友^
谎友^ 2020-12-24 07:33

Is it possible to get the route/virtual url associated with a controller action or on a view? I saw that Preview 4 added LinkBuilder.BuildUrlFromExpression helper, but it\'

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-24 08:09

    I wrote a helper class that allows me to access the route parameters. With this helper, you can get the controller, action, and all parameters passed to the action.

提交回复
热议问题