我正在使用ASP.NET Login Controls和Forms Authentication获取ASP.NET Web应用程序的成员资格/凭据。它会一直重定向到我的应用程序根目录下不存在的Login.aspx页面。我的登录页面位于文件夹中。
答案 0 :(得分:6)
对表单项使用LoginUrl属性吗?
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" ></forms>
</authentication>
答案 1 :(得分: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>