Client Script emitted from a Repeater Item Control

J

Joel Cade

I'm using a repeater to show the rows in a data table. I'd like the
have a link button beside each row that removes the record, firing a
client script function to prompt the user for confirmation, and then
run as a server control. I know how to attach client script to a
server control, but I'm not sure how to access the control of the
repeater item. Code follows:

<ItemTemplate>
<tr class="font8v">
<td><%# DataBinder.Eval(Container.DataItem, "FileName")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "Size"))%></td>
<td><asp:LinkButton id="btnOne" runat="server" Text="Remove"
CommandArgument='<%#DataBinder.Eval
Container.DataItem,"FileName")%>' ></asp:LinkButton>
</td>
</tr>
</ItemTemplate>

To add client script to a button, I'd do the following:
btnOne.Attributes.Add("onclick", "javascript:confirmRemove")

How do I programmatically do this to the repeater Item?

Thanks in advance for any help!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top