简单的Asp.Net登录

时间:2017-11-23 01:05:10

标签: asp.net login

我只想创建一个带有Response.Redirect的简单登录页面,这就是我正在尝试的内容。我哪里错了?

 protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text == "customer")
        {
        if (TextBox2.Text == "password");
        }
        Response.Redirect("Customer.aspx");
    }

1 个答案:

答案 0 :(得分:1)

第一个的结束括号如果需要在重定向之后。除了第二个if之后的半冒号外,其他一切都还可以。

protected void Button1_Click(object sender, EventArgs e) {
   if (TextBox1.Text == "customer") 
   { 
    if (TextBox2.Text == "password") 
        Response.Redirect("Customer.aspx");
   } 
}