ReturnURL不包含defaultURL文件

时间:2013-06-27 23:00:29

标签: web-config asp.net-membership returnurl

我正在尝试确定我的应用程序中的表单身份验证问题。具体来说就是ReturnURL参数。当我浏览到该地址时,我希望我的网址看起来像"http://www.example.com/ApplicationName/login.aspx?ReturnURL=%2fApplicationDirectory%2ListImages.aspx" "http://www.example.com/ApplicationName"

Web.Config包含

<authentication mode="Forms">
  <forms loginUrl="login.aspx" defaultUrl="ListImages.aspx" name=".WebDashboardAuth" />
</authentication>
<authorization>
  <deny users="?" />
</authorization>

创建的网址是"http://www.example.com/ApplicationName/login.aspx?ReturnURL=%2fApplicationDirectory%2",并且不显示defaultURL文件。

我的设置有什么问题?

1 个答案:

答案 0 :(得分:0)

如果defaultUrl中没有Web.Config,则ReturnURL中的

Querystring参数是将被访问的路径。它不会以Querystring传递。

如果未经过身份验证的用户转到ReturnURL,然后返回Querystring,则http://www.mydomain.com/ApplicationName/ListImages.aspx中的Login.aspx可能是您所期望的。只有这样,ReturnURL才会有路径。