473,657 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onclick in .net (vb) is undefined in datalist

When I click in a picture, I get a error the changePicture is undefined

<tr>
<td colSpan="2"><as p:datalist id="Picturelist " runat="server"
RepeatColumns=" 8">
<itemtemplate >
<img ID="Picture" height=100 width=100 onclick="change Picture"
runat="server" src='<%# DataBinder.Eval (Container.Data Item, "carPicture ") %>'
/>
</itemtemplate>
</asp:datalist></td>
</tr>

Public Sub changePicture(B yVal sender As System.Object, ByVal e As
System.EventArg s)

Dim item As DataListItem =
Picturelist.Ite ms(Picturelist. EditItemIndex)
If (Not item Is Nothing) Then
Dim ddl As DataList = CType(item.Find Control("Pictur e"), DataList)
Dim check As String = ddl.SelectedIte m.DataItem

Dim IDCar As Integer = CInt(Request.Pa rams("CarID"))
Dim Maintenance As MaintenanceDB = New MaintenanceDB

Dim myCarDetails As MaintenanceDeta ils =
Maintenance.Get ACar(IDCar)

Pictureheader.I mageUrl = myCarDetails.Ca rPictureHeader
End If
End Sub

Jul 21 '05 #1
2 1856
Stanley,

Did you know that there is as well an imagebutton which is in my opinion
very easy to use instead of the image for this..

In my opinion are better newsgroups for this kind of questions by the way
microsoft.publi c.dotnet.framew ork.aspnet
and
microsoft.publi c.dotnet.langua ges.vb

When you sent messages to both than that no problem when you do not know
what is better for your questions, you can send one message to both
newsgroups in one time (that is called crossposting). However do not send
two message to both one, that is hated by most people in newsgroups.

I hope this above helps anyway directly?

Cor

<tr>
<td colSpan="2"><as p:datalist id="Picturelist " runat="server"
RepeatColumns=" 8">
<itemtemplate >
<img ID="Picture" height=100 width=100 onclick="change Picture"
runat="server" src='<%# DataBinder.Eval (Container.Data Item, "carPicture ")
%>'
/>
</itemtemplate>
</asp:datalist></td>
</tr>

Public Sub changePicture(B yVal sender As System.Object, ByVal e As
System.EventArg s)

Dim item As DataListItem =
Picturelist.Ite ms(Picturelist. EditItemIndex)
If (Not item Is Nothing) Then
Dim ddl As DataList = CType(item.Find Control("Pictur e"),
DataList)
Dim check As String = ddl.SelectedIte m.DataItem

Dim IDCar As Integer = CInt(Request.Pa rams("CarID"))
Dim Maintenance As MaintenanceDB = New MaintenanceDB

Dim myCarDetails As MaintenanceDeta ils =
Maintenance.Get ACar(IDCar)

Pictureheader.I mageUrl = myCarDetails.Ca rPictureHeader
End If
End Sub

Jul 21 '05 #2
Thanks i got it

<td colSpan="2"><as p:datalist id="Picturelist "
OnItemCommand=" Picturelist_Ite mCommand" runat="server" RepeatColumns=" 8">
<itemtemplate >
<asp:ImageButto n ID="Picture" height=100 width=100
CommandName="se lect" runat="server" ImageUrl='<%#
DataBinder.Eval (Container.Data Item, "carPicture ") %>' />
</itemtemplate>
</asp:datalist></td>

Sub Picturelist_Ite mCommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data ListCommandEven tArgs) Handles
Picturelist.Ite mCommand
If (e.CommandName = "select") Then
Dim Maintenance As MaintenanceDB = New MaintenanceDB
Dim IDCarPicture As Integer =
Picturelist.Dat aKeys(e.Item.It emIndex)
Dim myPictureDetail s As MaintenanceDeta ils =
Maintenance.Get ACarpictureUrl( IDCarPicture)
Dim test As String = myPictureDetail s.carPicturePat hUrl
Pictureheader.I mageUrl = myPictureDetail s.carPicturePat hUrl
End If
End Sub
"Stanley J Mroczek" wrote:
When I click in a picture, I get a error the changePicture is undefined

<tr>
<td colSpan="2"><as p:datalist id="Picturelist " runat="server"
RepeatColumns=" 8">
<itemtemplate >
<img ID="Picture" height=100 width=100 onclick="change Picture"
runat="server" src='<%# DataBinder.Eval (Container.Data Item, "carPicture ") %>'
/>
</itemtemplate>
</asp:datalist></td>
</tr>

Public Sub changePicture(B yVal sender As System.Object, ByVal e As
System.EventArg s)

Dim item As DataListItem =
Picturelist.Ite ms(Picturelist. EditItemIndex)
If (Not item Is Nothing) Then
Dim ddl As DataList = CType(item.Find Control("Pictur e"), DataList)
Dim check As String = ddl.SelectedIte m.DataItem

Dim IDCar As Integer = CInt(Request.Pa rams("CarID"))
Dim Maintenance As MaintenanceDB = New MaintenanceDB

Dim myCarDetails As MaintenanceDeta ils =
Maintenance.Get ACar(IDCar)

Pictureheader.I mageUrl = myCarDetails.Ca rPictureHeader
End If
End Sub

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
17682
by: bob | last post by:
Hi, consider this script: <script> function doIt() { alert("ok") } document.onclick=doIt // or document.onclick=doIt() </script>
6
42213
by: waste | last post by:
hello. is it possible to clear onClick event? eg: <div ... onClick="someFunction()"> when I want to run someFunction() only once. -- waste
3
3254
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement "return promptBeforeOpening();" FF and IE rewrite it as I would expect them to, but it turns out that that doesn't work (no disclaimer pops up, and the link is not disabled):
4
2258
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML source:
3
2172
by: Glenn | last post by:
I've got a datalist that includes in each databound row a button to delete that specific record. But for some reason, clicking the button does not trigger the event handler. here's the datalist <form runat="server"><asp:Label id="lblErrorText" runat="server" cssclass="FormValidationErrorText" enableviewstate="False"></asp:Label><asp:Label id="lblAgreementNbr" runat="server" enableviewstate="False"></asp:Label><br /><br /><br /><asp:datalist...
2
327
by: Stanley J Mroczek | last post by:
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>
2
2279
by: milbrand | last post by:
I have an ASPX page with a DataList. The ListItems contain a DropDownList and a Hyper Link. The user selects an Item from the Dropdown box and then selects the hyperlink to edit that item. My thought was to grab the ID, ClientID, or UniqueID of the Hyperlink and then build the name of the DropDownList to grab the value to pass. The problem is that the value keeps coming back Undefined. How can I get the dynamic name created at...
2
7707
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the submit button to submit a form that contains one or two Mileposts: 1) If a Milepost range larger than 5 miles is entered, I would like to pop up a confirmation box to confirm the range.
6
2172
by: Nathan Sokalski | last post by:
I have a DataList which contains several LinkButtons, which are used to select a category in my application. I want the currently selected category to use a different CSS class. Here is an example of the generated code for one of the buttons: <a onclick="UnselectCategories();datCategories_ctl00_lnkCategory.className='Category_Selected';" id="datCategories_ctl00_lnkCategory" class="Category_Selected"...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.