protected void btnSave_Click(object sender, EventArgs e) { TextBox txtCTypeId = DetailsView1.FindControl("txtClientTypeID") as TextBox; TextBox txtCTypeTitle = DetailsView1.FindControl("txtClientTypeTitle") as TextBox; TextBox txtCTypeDesc = DetailsView1.FindControl("txtClientTypeDesc") as TextBox; int CTypeId = Convert.ToInt32(txtCTypeId.Text.ToString()); string CTypeTitle = txtCTypeTitle.Text.ToString(); string CTypeDesc = txtCTypeDesc.Text.ToString(); Debug.WriteLine(""); Debug.WriteLine("Data From Grid:"); Debug.WriteLine("CType ID: " + CTypeId); Debug.WriteLine("CType Title: " + CTypeTitle); Debug.WriteLine("CType Desc: " + CTypeDesc); DatabaseConnectivity dbcon = new DatabaseConnectivity(); int ResultQuery = dbcon.setClientType(CTypeId, CTypeTitle, CTypeDesc); //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>"); //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true); //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true); DetailsView1.Visible = false; //this.Page_Load(null, null); _BindService(); //UpdatePanel1.Update(); //UpdatePanel1.Update(); //DetailsView1.Style.Add("display", "none"); }