ASP.NET MVC 登录 ReturnUrl 始终为 NULL? [英] ASP.NET MVC Login ReturnUrl always NULL?

查看:38
本文介绍了ASP.NET MVC 登录 ReturnUrl 始终为 NULL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 ASP.NET MVC 中使用表单身份验证尝试重新登录站点时,它会在查询字符串中放置一个 ReturnUrl 参数.我的登录操作方法接受returnUrl"字符串.然而,似乎 returnUrl 字符串始终为空,即使它显然在查询字符串中也是如此.关于为什么会出现这种情况或可能的解决方法的任何想法?

Using Forms Authentication in ASP.NET MVC when trying to log back into a site, it puts a ReturnUrl parameter in the query string. My Logon action method accepts a "returnUrl" string. However it seems that returnUrl string is always null, even when it is clearly in the query string. Any thoughts on why this might be the case or a possible fix?

推荐答案

也许您没有在登录表单的操作属性中包含 ReturnURL 参数,从而发布到没有该参数的 URL?

Maybe you don't include the ReturnURL parameter into you login form's action attribute, thus posting to a URL without that parameter?

这篇关于ASP.NET MVC 登录 ReturnUrl 始终为 NULL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆