I've got a repeater with an itemlist, it get's data via C#/sql and a databind. I then want to add onclick javascript to my 'deleteNewsButton' in the itemlist. Im guessing that i have to use OnItemDataBound?
Heres my repeater:
<asp:Repeater ID="newsListRepeater" runat="server" OnItemDataBound="deleteConfirm_Databound">
<ItemTemplate>
<tr>
<td><%# Eval("id") %></td>
<td><%# Eval("title") %></td>
<td><%# Eval("tags") %></td>
<td><%# Eval("author") %></td>
<td style="width:100px;"><%# DataBinder.Eval(Container.DataItem, "time", "{0:dd/MM/yyyy}") %></td>
<td style="width:110px;">
<asp:Button ID="editNewsButton" runat="server" OnCommand="editNewsButton_Click" CommandArgument='<%# Eval("id") %>' Text="Rediger" />
<asp:Button ID="deleteNewsButton" runat="server" CommandArgument='<%# Eval("id") %>' Text="Slet" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
EDIT: How would i bind a paramter from behind code, to my 'deleteNewsButton' controllers. It needs to be done from behind code...