protected void TextBox1_TextChanged(object sender, EventArgs e) { try { bl.comp_nm = TextBox1.Text; DataSet ds = new DataSet(); ds = dl.secectcompnyname(bl); if (ds.Tables[0].Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('The Company Already Exists'); window.location='company_master.aspx';", true); } dwd_grp.Focus(); } catch (Exception) { } }