View Single Post
  #3 (permalink)  
Old January 19th, 2005, 04:47 PM
pjmair pjmair is offline
Authorized User
Join Date: Jun 2003
Location: , , .
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts

There's a lot of code, so I'll post what I think are the relevant parts. Here is my repeater control code:

<tr style="background-color:#F0F0F0">
<td height="17"><div align="center"><img src="../images/delete.GIF" border="0" onClick="Delete_Click(<%# Container.DataItem( "env_id" )%>);"></div></td>
<td><div align="center"><%# FormatDate(Container.DataItem( "cost_date" )) %></div></td>
<td><div align="center"><%# Container.DataItem( "task_desc_env" ) %></div></td>
<td><div align="left"><%# Container.DataItem( "description" ) %></div></td>
<td><div align="center"><%# Format2Decs(Container.DataItem( "units" ).ToString()) %></div></td>
<td><div align="center"><%# Format2Decs(Container.DataItem( "cost_per" ).ToString()) %></div></td>
<td><div align="right"><%# AddBling(Container.DataItem( "cost" )) %></div></td>    
So it's the very first item in the list, where I've got an image I'm putting in that field and I wanted to set that images onClick property to point at the function Delete_Click, and pass along the data from the datareader as a parameter for Delete_Click to work with. I haven't got the code for Delete_Click written yet, I've just got a little test function that should take the same parameter and spit out a little text...

Function Delete_Click(string env_id)
Dim strTest
strTest = env_id
Response.Write( "I want to delete record: " & strTest)
End Function
When I click on the image that should lauch Delete_Click I just get an error: Object expected. Any thoughts on what I'm missing?