protected void gv_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { int intCandidateProfileID = Convert.ToInt32(((Label)gv.Rows[e.RowIndex].FindControl("CandidateProfileID")).Text); ICandidateManager objCandidateManager = CandidateManagerFactory.Candidate_Manager(); if (objCandidateManager.DeleteCandidateProfile(intCandidateProfileID) == 0) { string script2 = "alert('Candidate with ID:'" + intCandidateProfileID + "' has been deleted');"; ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script2, true); } showgrid(Convert.ToInt32(ddlvacancy.SelectedItem.Text)); } catch (Exception) { } }