protected void Button1_Click(object sender, EventArgs e) { try { bl.unit_name = txt_nm.Text; bl.decimal_no = DropDownList1.SelectedValue.ToString(); dl.insertunit(bl); ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('Unit Created successfully'); window.location='unit_master.aspx';", true); } catch (Exception ex) { } }