开发者

How do get the current url in a renderaction

开发者 https://www.devze.com 2023-01-08 07:33 出处:网络
When I get the cu开发者_如何学编程rrent url in a renderaction using Request.Url.ToString() It returns the url of the renderaction and not the page. Is there a way to get the current url of the page

When I get the cu开发者_如何学编程rrent url in a renderaction using

Request.Url.ToString()

It returns the url of the renderaction and not the page. Is there a way to get the current url of the page?


Use the ParentActionViewContext property:

ParentActionViewContext.HttpContext.Request.Url.ToString()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号