protected void Asignin_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); li.user_name = adminUname.Text; li.admin_password = adminPassword.Text; dt = li.a_login(li); if (dt.Rows.Count > 0) { Session["user_name"] = dt.Rows[0]["user_name"].ToString(); Response.Redirect("adminhome.aspx"); } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Invalid Username and Password')</script>"); } }