G
Guest
When I click in a picture, I get a error the changePicture is undefined
<tr>
<td colSpan="2"><asp:datalist id="Picturelist" runat="server"
RepeatColumns="8">
<itemtemplate>
<img ID="Picture" height=100 width=100 onclick="changePicture"
runat="server" src='<%# DataBinder.Eval(Container.DataItem, "carPicture") %>'
/>
</itemtemplate>
</asp:datalist></td>
</tr>
Public Sub changePicture(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim item As DataListItem =
Picturelist.Items(Picturelist.EditItemIndex)
If (Not item Is Nothing) Then
Dim ddl As DataList = CType(item.FindControl("Picture"), DataList)
Dim check As String = ddl.SelectedItem.DataItem
Dim IDCar As Integer = CInt(Request.Params("CarID"))
Dim Maintenance As MaintenanceDB = New MaintenanceDB
Dim myCarDetails As MaintenanceDetails =
Maintenance.GetACar(IDCar)
Pictureheader.ImageUrl = myCarDetails.CarPictureHeader
End If
End Sub
<tr>
<td colSpan="2"><asp:datalist id="Picturelist" runat="server"
RepeatColumns="8">
<itemtemplate>
<img ID="Picture" height=100 width=100 onclick="changePicture"
runat="server" src='<%# DataBinder.Eval(Container.DataItem, "carPicture") %>'
/>
</itemtemplate>
</asp:datalist></td>
</tr>
Public Sub changePicture(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim item As DataListItem =
Picturelist.Items(Picturelist.EditItemIndex)
If (Not item Is Nothing) Then
Dim ddl As DataList = CType(item.FindControl("Picture"), DataList)
Dim check As String = ddl.SelectedItem.DataItem
Dim IDCar As Integer = CInt(Request.Params("CarID"))
Dim Maintenance As MaintenanceDB = New MaintenanceDB
Dim myCarDetails As MaintenanceDetails =
Maintenance.GetACar(IDCar)
Pictureheader.ImageUrl = myCarDetails.CarPictureHeader
End If
End Sub