protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { try { GridViewRow row = GridView1.Rows[e.RowIndex]; string id = (row.FindControl("lblId") as Label).Text; db.DeletePaper(int.Parse(id)); } catch (Exception ex) { exceptionLable.Text = ex.Message; } finally { GridView1.EditIndex = -1; this.BindGrid(); } }