62,046
社区成员
发帖
与我相关
我的任务
分享
forms验证,web.config如下:
<authentication mode="Forms">
<forms requireSSL="true" name="myAuthentication" loginUrl="login.aspx" protection="All" timeout="60" path="/" />
</authentication>
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "admin" && TextBox2.Text == "xiaobai")
{
FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, true);//此处有错误。
//Response.Redirect("ShowAuth.aspx");
}
else
{
Response.Write("对不起,请输入正确的账号密码。");
}
}