im having a simple login page which i have created using asp.net c#. What im trying to do is retrieve the user level and assign it to a session and redirect to the appropriate page based on the level. But when i login nothing happens.. below is my code. can someone tell me what is wrong with my code?
con.Open();
com.CommandText = "Select * from deatls Where c_id = '" + TextBox1.Text + "' and password = '" + TextBox2.Text + "'";
com.CommandType = CommandType.Text;
com.Connection = con;
SqlDataReader sqlread = com.ExecuteReader();
if (sqlread.Read())
{
Session["level"] = sqlread["level"];
}
if ((int)Session["level"] == '1')
Response.Redirect("customer_menu.aspx");
if ((int)Session["level"] == '2' )
Response.Redirect("front.aspx");
if ((int)Session["level"] == '3')
Response.Redirect("manager.aspx");
else
Response.Redirect("login.aspx");
con.Close();
Session["level"]gets assigned etc.