protected void lnkDelete_Click(object sender, EventArgs e) { int indexid = ((GridViewRow)((LinkButton)sender).Parent.Parent).RowIndex; string ID = grddocumentdata.Rows[indexid].Cells[3].Text; string Filename = grddocumentdata.Rows[indexid].Cells[0].Text; ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); Client.DeleteDocument(Convert.ToInt32(ID)); if (File.Exists(Request.PhysicalApplicationPath + "Downloads//" + Filename)) { File.Delete(Request.PhysicalApplicationPath + "Downloads//" + Filename); } DocumentBind(); }