I have the following repeater setup, i have some regular image links that i want to convert to image buttons:
asp Code:
<asp:Repeater ID="rptClientMatterCodes" runat="server">
<HeaderTemplate>
<table class="forumborder" border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
<tr class="title1">
<td colspan="3">
Current Client Matter Codes
</td>
</tr>
<tr class="title2">
<td>Email Address</td>
<td>Long Distance Code</td>
<td> </td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="row2">
<td><%#Container.DataItem("email")%></td>
<td><%#functions.Padd(Container.DataItem("code"), 4, "0", "L")%></td>
<td class="center"><a href="index.asp?action=editCode&id=<%#Container.DataItem("id")%>"><img src="theme/buttons/edit.jpg" alt="Edit Client Matter Code" /></a>  <a href="index.asp?action=deleteCode&id=<%#Container.DataItem("id")%>" onclick="return confirmDelete('Client Matter Code')"><img src="theme/buttons/delete.jpg" alt="Delete Client Matter Code" /></a></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
I want the image buttons to take care of editing and deleting, the one im having issues with right now is the deleting one, i want each button to run a function and pass the value of a database field called "id" to the function which will run a delte query on the database based on the id. Heres what i trid to do:
asp Code:
<asp:Repeater ID="rptClientMatterCodes" runat="server">
<HeaderTemplate>
<table class="forumborder" border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
<tr class="title1">
<td colspan="3">
Current Client Matter Codes
</td>
</tr>
<tr class="title2">
<td>Email Address</td>
<td>Long Distance Code</td>
<td> </td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="row1">
<td><%#Container.DataItem("email")%></td>
<td><%#functions.Padd(Container.DataItem("code"), 4, "0", "L")%></td>
<td class="center">
<a href="index.asp?action=editCode&id=<%#Container.DataItem("id")%>"><img src="theme/buttons/edit.jpg" alt="Edit Client Matter Code" /></a>
<asp:ImageButton ID="btnDelete<%#Container.DataItem("id")%>" runat="server" CommandArgument="<%#Container.DataItem("id")%>" CommandName="btnClickDelete" ImageUrl="theme/buttons/delete.jpg" onclick="return confirmDelete('Client Matter Code')" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The only problem is that it appears that i cant use onclick="return confirmDelete('Client Matter Code')" in asp items, can someone suggest a fix?