为什么login控件在身份证验之后,自动跳转到另一个网页了?
web.config中的相关代码为:
<authentication mode= "Forms ">
<forms loginUrl= "login.aspx " timeout= "30 "> </forms>
</authentication>
<authorization>
<deny users= "? " />
</authorization>
login.aspx中的相关代码为:
<asp:Login ID= "Login1 " runat= "server " OnAuthenticate= "Login1_Authenticate ">
</asp:Login>
login.aspx.cs中相关代码为:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if (Login1.UserName == "1 " && Login1.Password == "1 ")
{
e.Authenticated = true;
}
}