SqlCommand cmd = new SqlCommand(); cmd.CommandText = "hod_login"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = Db.GetConnection(); cmd.Parameters.AddWithValue("@LoginID", TextBox1.Text); cmd.Parameters.AddWithValue("@Password", TextBox2.Text); cmd.Parameters.AddWithValue("@UserType", DropDownList1.Text); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { if (dr[2].ToString() == "Commercial" && DropDownList1.Text == "HOD") { Session["userid"] = TextBox1.Text; Session["tag"] = DropDownList1.Text; Session["deptt"] = "Commercial"; //ViewState["deptt"] = "Commercial"; Response.Redirect("onlineforms.aspx"); } } else { Response.Write("Invalid User"); } }
TextBox1
TextBox2
DropDownList1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)