Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Help! Having trouble calling codebehind function from repeater results!

Reply
Thread Tools

Help! Having trouble calling codebehind function from repeater results!

 
 
Kent P. Iler
Guest
Posts: n/a
 
      03-07-2004
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
----------------------------------------------------------------------
http://www.velocityreviews.com/forums/(E-Mail Removed)
Please CC: all replies via e-mail
Remove .NOSPAM from e-mail address


 
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
Help: PageDataSource, Repeater and Codebehind function... =?Utf-8?B?Um95?= ASP .Net 2 01-11-2005 09:33 PM
Help! Having trouble calling codebehind function from repeater results! Kent P. Iler ASP .Net Web Controls 0 03-07-2004 11:04 PM
Help! Having trouble calling codebehind function from repeater results! Kent P. Iler ASP .Net 0 03-07-2004 11:04 PM
Calling a Javascript function using VB.NET Codebehind rahulkate ASP .Net 0 02-26-2004 01:36 PM
Calling a function in codebehind from the html side of the aspx? exshige ASP .Net 2 07-08-2003 07:25 AM



Advertisments