更新时间:2022-12-10 19:39:27
Looks like it is issue with Link button and its command argument. Follow below code snippet:
Gridview code:
Looks like it is issue with Link button and its command argument. Follow below code snippet:
Gridview code:
<asp:gridview id="GrdVwViewUser" runat="server" enableviewstate="true" borderstyle="None" autogeneratecolumns="false" cssclass="col-md-4 col-xs-4 text-center" xmlns:asp="#unknown">
<columns>
<asp:templatefield>
<itemtemplate>
<asp:linkbutton id="btnApprove" runat="server">
CommandArgument='<%#Eval("ID")%>'
OnCommand="LnkBtnApprove_Command" Text="Approve">
</asp:linkbutton>
</itemtemplate>
.........
</asp:templatefield>
</columns>
.........
</asp:gridview>
Code-Behind code:
Code-Behind code:
protected void LnkBtnApprove_Command(Object sender, CommandEventArgs e)
{
int id = int32.Parse(e.CommandArgument.ToString());
// Imeplement your logic
}