Client Script emitted from a Repeater Item Control

Discussion in 'ASP .Net' started by Joel Cade, Jul 16, 2003.

  1. Joel Cade

    Joel Cade Guest

    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!!
    Joel Cade, Jul 16, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TR
    Replies:
    1
    Views:
    371
    Bruce Barker
    May 24, 2005
  2. Paul
    Replies:
    0
    Views:
    315
  3. David Mathog
    Replies:
    2
    Views:
    344
    Dave Thompson
    Jul 11, 2005
  4. How do I stop this javascript from being emitted?

    , Sep 15, 2006, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    144
    Teemu Keiski
    Sep 17, 2006
  5. Replies:
    1
    Views:
    102
    gerry
    Sep 15, 2006
Loading...

Share This Page