protected void Button3_Click(object sender, EventArgs e) { try { bl.ld_nm = TextBox1.Text; bl.grp_id = Convert.ToInt32(dwd_grp.SelectedValue.ToString()); bl.ld_remark = TextBox2_remark.Text; dl.insert_ledger(bl); ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('Ledger Created successfully'); window.location='company_list.aspx';", true); } catch { } }