且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我正在尝试使用linq将所有值从一个表插入另一个表。

更新时间: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
}