The code behind file creates a list of employees and the asp.net page loops through list.
Now, How do I assign the employeedID to the commandArgument of an asp:button?
<%foreach(var employee in employeesList){%>
<tr>
<td><%=employee.firstName%></td>
<td><%=employee.lastName%></td>
/*How to access employee.Id in the commandArgument? */
<td><asp:Button ID="btnDeleteEmployee" runat="server" CommandArgument='' Text="Delete" OnCommand="btnDeleteEmployee_Click" /></td>
</tr>
<%}%>
Based on your comments, here is a nested example:
Markup:
CodeBehind: