我注意到Stackoverflow登录/注销链接上的returnurl URL参数没有被转义,但是当我尝试将路径作为参数添加到路由时,它会被转义.
所以/ login?returnurl =/questions/ask shows/login?returnurl =%2fquestions%2fask,这有点难看.如何让它不能逃避returnurl值?
这是我在代码中所做的事情:
Html.ActionLink("Login", "Login", "Account", new { returnurl=Request.Path }, null)
Run Code Online (Sandbox Code Playgroud)