You are getting this error because you don't have not specified any
in the Approve
, but trying to access it.
So, if you want to get the index of the
row from which
is clicked then you need to add that row index in the
property like below.
<asp:LinkButton ID="lbnView" runat="server" Text="Approve" CommandName="Approve" CommandArgument="<%#((GridViewRow)Container).RowIndex%>">
As we have given the rowindex to the
now, so when you execute the code, you will get the index of the row from which the button is clicked.
Refer Get RowIndex In GridView RowCommand Event Using DataKey
] for more details.