GridViewRow gvr = (GridViewRow)((LinkButton)sender).Parent.Parent; string petID = this.GridView1.DataKeys[gvr.RowIndex].ToString();