I am trying to build a small login web application in ASP.NET but now I'm getting an error while filling and submitting the form in live browser preview
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
con.Open();
string query = "select * from login where user_login='" + txtuser.Text+ "' and '" + txtpass.Text + "' ";
SqlCommand cmd = new SqlCommand(query, con);
string output = cmd.ExecuteScalar().ToString();
if (output == "0")
{
Session["user"] = txtuser.Text;
Response.Redirect("");
}
else
Response.Write("Login Failed");
}