如何覆盖 ReturnUrl 查询字符串参数值的设置方式?
如果用户在未经身份验证的情况下请求页面,他们将被重定向到查询字符串中包含返回 URL 的登录页面。然而,返回 URL 是物理资源,但在我们的应用程序中,我们使用虚拟资源,这些虚拟资源通过 URL 重写映射到物理资源。
因此,如果用户最初请求:
http://foo.com/bar/Pages/Performance/Employee/Summary.aspx?ID=1104
登录后,对 FormsAuthentication.RedirectFromLoginPage
的调用会将其重定向到:
http://foo.com/bar/Pages/Performance/Summary.aspx?ID=1104
这假设该页面物理位于 Pages/Performance 中。
如何更改 ReturnUrl 参数的设置方式?
If a user requests a page when they're not authenticated they are redirected to a login page with a return URL in the query string. However, the return URL is a physical resource but in our application we use virtual resources which map to physical resources using URL rewriting.
So if the user originally requested:
http://foo.com/bar/Pages/Performance/Employee/Summary.aspx?ID=1104
After logging in the call to FormsAuthentication.RedirectFromLoginPage
will redirect them to:
http://foo.com/bar/Pages/Performance/Summary.aspx?ID=1104
That's assuming that the page is physically located in Pages/Performance.
How do I change the way the ReturnUrl parameter is set?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论