Help! Having trouble calling codebehind function from repeater results!

Discussion in 'ASP .Net Datagrid Control' started by Kent P. Iler, Mar 7, 2004.

  1. Kent P. Iler

    Kent P. Iler Guest

    Hi,

    I have a data repeater that is returning a list of events. One of the
    things I want to do is give the user a way to edit or delete an event. My
    plan was to use an Imagebutton that would invoke a codebehind function that
    would either edit or delete the item. My problem is I need to pass the
    event_id as a parameter to each of these functions so I know what event to
    edit/delete. The error code is complaining about the way I'm trying to pass
    the parameter in the repeater results.

    Can anyone help with this? I'm including the error code and source below.

    Error Code:
    ----------------------------
    http://localhost/BVA/edit_events.aspx(82) : error BC30201: Expression
    expected.

    AddHandler __ctrl.Click, AddressOf
    Me.EditEvent(<%#container.DataItem("event_id")%>)
    ~
    http://localhost/BVA/edit_events.aspx(82) : error BC30201: Expression
    expected.

    RemoveHandler __ctrl.Click, AddressOf
    Me.EditEvent(<%#container.DataItem("event_id")%>)
    ~
    http://localhost/BVA/edit_events.aspx(84) : error BC30201: Expression
    expected.

    AddHandler __ctrl.Click, AddressOf
    Me.DeleteEvent(<%#container.DataItem("event_id")%>)
    ~
    http://localhost/BVA/edit_events.aspx(84) : error BC30201: Expression
    expected.

    RemoveHandler __ctrl.Click, AddressOf
    Me.DeleteEvent(<%#container.DataItem("event_id")%>)
    ----------------------------


    Code sample:
    ----------------------------
    <ItemTemplate>
    <tr>
    <td nowrap class="tableRow">
    <%#container.DataItem("event_date")%></td>
    <td nowrap class="tableRow">&nbsp;</td>
    <td nowrap class="tableRow"><%#container.DataItem("event_name")%></td>
    <td nowrap class="tableRow">&nbsp;</td>
    <td nowrap class="tableRow"><asp:ImageButton Runat="server"
    ImageUrl="Images/edit.gif"
    onclick='EditEvent(<%#container.DataItem("event_id")%>)'></asp:ImageButton><
    /td>
    <td nowrap class="tableRow">&nbsp;</td>
    <td nowrap class="tableRow"><asp:ImageButton Runat="server"
    ImageUrl="Images/delete.gif"
    onclick='DeleteEvent(<%#container.DataItem("event_id")%>)'></asp:ImageButton
    ></td>

    </tr>
    </ItemTemplate>
    ----------------------------


    Thank you!

    --Kent Iler
    ----------------------------------------------------------------------

    Please CC: all replies via e-mail
    Remove .NOSPAM from e-mail address
    Kent P. Iler, Mar 7, 2004
    #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. Kent P. Iler
    Replies:
    0
    Views:
    610
    Kent P. Iler
    Mar 7, 2004
  2. =?Utf-8?B?Um95?=
    Replies:
    2
    Views:
    3,138
    =?Utf-8?B?Um95?=
    Jan 11, 2005
  3. Andreas Lagemann
    Replies:
    8
    Views:
    462
    Mike Wahler
    Jan 10, 2005
  4. tiwy
    Replies:
    0
    Views:
    427
  5. Kent P. Iler
    Replies:
    0
    Views:
    180
    Kent P. Iler
    Mar 7, 2004
Loading...

Share This Page