if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton btnDelete = (ImageButton)e.Row.Cells[1].Controls[0]; string PersonName = e.Row.ToolTip = "Delete " + PersonName ; btnDelete.Attributes.Add("onClick", "var ch=confirm('Do you want to delete " + PersonName + "?');if(ch==false) return false;"); btnDelete.CommandName = "Delete"; } }but I could not figure out how to access LastName and FirstName from my GridView.