3

我正在使用ASP.NET 登录控件表单身份验证来获取 ASP.NET Web 应用程序的成员资格/凭据。它不断重定向到我的应用程序根目录中不存在的 Login.aspx 页面。我的登录页面在一个文件夹中。

4

2 回答 2

6

为表单项使用 LoginUrl 属性?

<authentication mode="Forms">
  <forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" ></forms>
</authentication>
于 2008-08-28T18:59:05.527 回答
1

我在CoderSource.net找到了答案。我必须将正确的路径放入我的 web.config 文件中。

<?xml version="1.0"?>
<configuration>
    <system.web>
        ...
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <authentication mode="Forms">
            <forms loginUrl="~/FolderName/Login.aspx" />
        </authentication>
        ...
    </system.web>
    ...
</configuration>
于 2008-08-28T18:56:52.117 回答