Get full URL with hash to use as ReturnUrl

一笑奈何 提交于 2019-12-09 11:24:45

问题


I have such URL

localhost/Login/LogOn?ReturnUrl=/#&q=my%20search%20word&f=1//447044365|2//4

I need to get hash parameters to navigate in the application after authentication.

I try to catch it like this

<input name="returnUrl" value="<%= ViewContext.HttpContext.Request.Url.PathAndQuery %>" type="hidden" />

But result is

/Login/LogOn?ReturnUrl=/

I tried to take away "/#" in the URL, then I get whole URL. But I need to use this URL as it is.

Why was URL cutted?


回答1:


The browser does not send the hash fragment to the server. It used on the client-side only. If you need it you will have to access it through client-side script.



来源:https://stackoverflow.com/questions/5536560/get-full-url-with-hash-to-use-as-returnurl

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