我使用 ASP.NET 会员提供程序在我的本地计算机上设置了此会员站点。当我去:
它把我重定向到
http://localhost/Login.aspx?ReturnUrl=%2fadmin%2fDefault.aspx
这很好。但是在我输入登录信息后,页面似乎刷新了。它实际上并没有让我登录,它看起来只是刷新了页面。如果我将 URL 更改为:
它工作正常。它让我没有问题,并将我重定向到我的默认页面。我还检查了现场网站,它也做了同样的事情。有任何想法吗?提前致谢!
编辑:这是标记:
<asp:Login ID="Login1" runat="server" CssClass="LoginBox" TitleText="Please Log In">
<LayoutTemplate>
<h2>
Please Log In:</h2>
<p runat="server" id="FailureText" visible="false">
Either your email address or password was incorrect. Please try again.</p>
<strong>Email</strong><br />
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
Text="*"></asp:RequiredFieldValidator>
</p>
<p>
<strong>Password</strong><br />
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
Text="*"></asp:RequiredFieldValidator>
</p>
<p>
<asp:Button ID="Login" CommandName="Login" runat="server" Text="Log In" /></p>
<p>
Please <a runat="server" id="Link_ContactUs">contact </a>an administrator if you
are having trouble logging in or have forgotten your password.</p>
</LayoutTemplate>
</asp:Login>
web.config 设置:
<authentication mode="Forms">
<forms loginUrl="/Login.aspx"
protection="All"
timeout="60"
name="AppNameCookie"
path="/Admin"
requireSSL="false"
slidingExpiration="true"
defaultUrl="/Admin/Default.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false" />
</authentication>