public void Update() { DataSet Ds = new DataSet(); try { if ((CMID != "") && (CMID != "System.Data.DataRowView") && (EmployeeIdTextBox.Text != "") && (EmployeeIdTextBox.Text != "System.Data.DataRowView")) { DBM.CMID = CMID.ToString(); DBM.IEmpId = EmployeeIdTextBox.Text.ToString().TrimStart().TrimEnd(); DBM.HEmployeeName = EmployeeTextBox.Text.TrimStart().TrimEnd(); //DBM.IDepID = SIDepID.ToString(); //DBM.IDesID = SIDesID.ToString(); if (OthersTextBox.Text == "") { DBM.IDepName = DepartmentTextBox.Text.ToString().TrimStart().TrimEnd(); DBM.ODepName = MemDesignationDDList.Text.ToString().TrimStart().TrimEnd(); } else { DBM.IDepName = OthersTextBox.Text.TrimStart().TrimEnd(); DBM.ODepName = "Other"; } DBM.Remark1 = "D"; DBM.Remark2 = "0"; DBM.ComEvalUpdate(DBM); string myscript = "alert ('Record Has Been Deleted Succesfully');"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", myscript, true); //ClientScript.RegisterStartupScript(this.GetType(), "randomtext", "alertme('Your Suggestion Posted')", true); //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your Suggestion Posted')", true); i = 1; } else { string myscript = "alert ('No Record Has Been Selected');"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", myscript, true); } } catch (Exception ex) { throw new Exception("Error Initializing Data Class." + Environment.NewLine + ex.Message); } }