Handling the clicking on an image event

garcon

Well-known member
Joined
Dec 13, 2004
Messages
47
Programming Experience
Beginner
Hi,

I have an image which looks like a button. code as follows:

<input type="image" name="imgSubmit" id="imgSubmit" onmousedown="ValidateCurrencySelection()" src="images/EN.gif" alt="Click here to calculate the amount to be charged at the end of your booking" border="0" />


I am trying to handle the clicking on the image using the following code:


' Handles the clicking of the big yellow button
Sub imgSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles imgSubmit.Click


End Sub


Problem is though under the second "imgSubmit" I receive the following error message:

"Handles clause requires a WithEvents variable"



Anyone with any ideas how to solve this??

Merci,
G.
 
Neal,

I've used the following:


<a href="WebForm1.aspx"><input type="image" name="imgSubmit" id="imgSubmit" onmousedown="ValidateCurrencySelection()" src="images/EN.gif" alt="Click here to calculate the amount to be charged at the end of your booking" border="0" /></a>


Where WebForm1.aspx is the form handling the click. Saved & recompiled but still no joy. I'm receiving the same error message:
"Handles clause requires a WithEvents variable"

Confused,
g.
 
Back
Top