I have a button in each line of the list.
I have a click event method in which I would like to get the item id.
I placed hidden fieldin the list to save the identifier.
However
ListView1.FindControl("hiddenField") is returning null.
I tried several different event arguments, but only this command works with this button, so there is nothing in the event arguments.
I tried to set the command button call commandEventArgs, but no matter what args events I use besides "eventArgs", I get:
No overload for 'btnManage_Click' matches delegate 'System.EventHandler'
How do I get the args event in this button?
EDIT
The button is located in the ItemTemplate section of the following ListView.
<asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" EnableModelValidation="True" DataKeyNames="Id" InsertItemPosition="LastItem" >
<LayoutTemplate>
<table id="Table2" class="table" runat="server">
<tr id="Tr1" runat="server">
<td id="Td1" runat="server">
<table runat="server" id="itemPlaceholderContainer" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;" border="1">
<tr id="Tr2" runat="server" style="background-color: #DCDCDC; color: #000000;">
<th id="Th1" runat="server"></th>
<th id="Th2" runat="server">Name</th>
<th id="Th3" runat="server">Manage</th>
</tr>
<tr runat="server" id="itemPlaceholder"></tr>
</table>
</td>
</tr>
<tr id="Tr3" runat="server">
<td id="Td2" runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;"></td>
</tr>
</table>
</LayoutTemplate>
source
share