我正在开发一个 ASP.NET Web 窗体应用程序,并且我Account
在根目录下有一个文件夹。其中主要包含三个 ASPX 页面:Login.aspx
, ChangePassword.aspx
, ForgotPassword.aspx
.
我已经使用自定义成员资格提供程序配置了表单身份验证。
网络配置
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" slidingExpiration="true" timeout="2880" path="/" protection="All" />
</authentication>
<membership defaultProvider="CustomMembershipProvider">
<providers>
<clear/>
<add name="CustomMembershipProvider"
type="App_Code.CustomMembershipProvider, Portal.Web"
connectionStringName="PortalConnectionString"
applicationName="/" />
</providers>
</membership>
如果我尝试访问Account
文件夹中的页面而不是Login.aspx
我一直重定向到的页面,Login.aspx
并且我目前正在避免其他两个页面的表单身份验证,如下所示,
<location path="Account/ChangePassword.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Account/ForgotPassword.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
我可以将它们组合起来,而不是像上面那样指定单个页面吗?我尝试Account
在path
属性中指定文件夹名称,但这不起作用。
接下来是我Dashboard.aspx
在根目录中调用了另一个页面,每当我直接访问它时,我以为我会被重定向到该Account/Login.aspx
页面,但它没有发生,为什么?