传递带有哈希值的URL以进行重定向 [英] Pass URL's with hash value for redirection
本文介绍了传递带有哈希值的URL以进行重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
如何从服务器端获取网址哈希(#)
Possible Duplicate:
How to get Url Hash (#) from server side
我在从变量获取 hash 值时遇到了一些麻烦.
I'm having some trouble to get the hash value from a variable.
我正在使用AccountController
[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl) { ... }
但是如果我通过此链接:
but if I pass this link on:
http://localhost:1357/none/Account/LogOn?returnUrl=a/b/c#day-22
我再也听不到#day-22
值
下面是登录后的断点:
我从来没有在HttpContext.Request.Url
对象上获得哈希值.
I never get the hash value on the HttpContext.Request.Url
object.
我该怎么做,以将用户转发到带有哈希值部分的正确的URL ?
What can I do to forward the user to the correct URL with the hash part?
推荐答案
您需要对其进行urlencode.
You need to urlencode it.
尝试:http://localhost:1357/none/Account/LogOn?returnUrl=a/b/c%23day-22
这篇关于传递带有哈希值的URL以进行重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文