如何找到用于在 MVC 中调用我的控制器的 href
从控制器操作内部,我想获取单击以进入操作的完整 href 地址。
这可能吗?如果可以的话,我怎样才能在 MVC 中得到它呢?
From inside a controller action I would like to get the full href address that was clicked on to get me to the action.
Is this possible and if so then how can I get that in MVC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您可以使用当前的 UrlReferrer 属性请求:
这将读取 Referer 来自请求的 HTTP 标头,可能由客户端(用户代理)提供,也可能不提供。
You could use the UrlReferrer property of the current request:
This will read the Referer HTTP header from the request which may or may not be supplied by the client (user agent).