I have an OnItemCommand event not firing for a Repeater control using VB.NET for ASP.NET and I can't figure out why!? I have a UserControl with the following Repeater:
The sub in the code behind is as follows:
Any ideas or am I just losing my mind?
Thanks,
Mike
Code:
<asp:repeater id="RepeaterMemberList" OnItemCommand="ImageButton_ItemCommand" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="center"> </td>
<td align="center">
<asp:ImageButton CommandName="Edit" CommandArgument='<%# Container.DataItem("ChannelPartnerID") %>' ImageUrl="~/assets/icons/icn_edit.gif" AlternateText="Edit" width="16" height="16" BorderWidth=2 BorderStyle=Solid BorderColor=White Runat=server>
</asp:ImageButton>
</td>
<td class="bg_border-light">
<img src="/assets/spacers/spacer.gif" alt="" width="1" height="1">
</td>
<td align="center" class="bg_table">
<asp:ImageButton CommandName="Delete" CommandArgument='<%# Container.DataItem("ChannelPartnerID") %>' ImageUrl="~/assets/icons/icn_delete.gif" AlternateText="Delete" width="16" height="16" BorderWidth=2 BorderStyle=None Runat=server>
</asp:ImageButton>
</td>
<td class="bg_border-light">
<img src="/assets/spacers/spacer.gif" alt="" width="1" height="1">
</td>
<td align="center">
<asp:ImageButton CommandName="Details" CommandArgument='<%# Container.DataItem("ChannelPartnerID") %>' ImageUrl="~/assets/icons/icn_details.gif" AlternateText="Details" width="16" height="16" BorderWidth=2 BorderStyle=None Runat=server>
</asp:ImageButton>
</td>
<td class="bg_border-light">
<img src="/assets/spacers/spacer.gif" alt="" width="1" height="1">
</td>
<td class="txt_label-menu">
<%# Container.DataItem("ChannelPartnerName") %>
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
</SeparatorTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:repeater>
The sub in the code behind is as follows:
Code:
Public Sub ImageButton_ItemCommand(ByVal sender As System.Object, ByVal e As RepeaterCommandEventArgs)
Select Case e.CommandName
Case "Edit"
Response.Write("Edit button clicked for item ID = " & e.CommandArgument)
Case "Delete"
Response.Write("Delete button clicked for item ID = " & e.CommandArgument)
Case "Details"
Response.Write("Details button clicked for item ID = " & e.CommandArgument)
End Select
End Sub
Any ideas or am I just losing my mind?
Thanks,
Mike