Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Client Script emitted from a Repeater Item Control

Reply
Thread Tools

Client Script emitted from a Repeater Item Control

 
 
Joel Cade
Guest
Posts: n/a
 
      07-16-2003
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!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop this javascript from being emitted? paul.hester@gmail.com ASP .Net Building Controls 3 09-17-2006 11:58 AM
How do I stop this javascript from being emitted? paul.hester@gmail.com ASP .Net Web Controls 1 09-15-2006 12:22 PM
How do I stop this javascript from being emitted? Paul ASP .Net 0 09-14-2006 11:05 PM
setting MAX characters emitted in printf() functions? David Mathog C Programming 2 07-11-2005 01:07 AM
Controlling what kind of HTML is emitted by standard web controls TR ASP .Net 1 05-24-2005 04:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57