protected void grdViewTunti_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { string strId = grdtunnit.Rows[e.RowIndex].Cells[2].Text.Trim(); if (strId.Length > 0) { TunnitDAL objTuntiDAL = new TunnitDAL(); objTuntiDAL.Delete(strId); ClearScreen(); BindGrid(); lblMessage.Text = "Record deleted successfully"; } } catch (Exception ex) { lblMessage.Text = "There is an error occured while processing the request. Please verify the code!"; } }