Custom Event ?

Burning

Newcomer
Joined
Dec 3, 2003
Messages
13
Location
Cape Town, South Africa
I've been breaking my head with this problem.

I have a custom control that exsist of a textbox and as Image.

PHP:
Protected WithEvents _Image As New System.Web.UI.HtmlControls.HtmlImage

Now an image does not have a Click event... What do i need to do to add a Click event to it??

Any help will be appreciated!
James
 
Why not change the HtmlImage control to be an ASP:ImageButton control? This would be a lot easier than the alternative, which would mean either extending the HtmlImage control, or implementing the postback interfaces in your custom control...
 
I too am perplexed by this ability and was just about to post a question on it. The reason you wouldn't want to use an ASP image button control is the lack of capability of a mouseover effect which is inherent in the DHTML properties of the HTML image tag.

From the research I have done, it looks as though you'll need to write your own handler whose prototype matches that of the event delegate. In other words, you create an event handler (like onClick) for the HTML button.

This event handler does something (like change a picture, etc.) based off of the parameter being passed to it.

I'm trying to create this same effect by passing the id of the HTML image through the custom event handler which uses a select/case statement in the code behind page to call up the write code. I'm having an issue, however, calling this through a script (as I need to do using the onClick method of the HTML image control).

Thus, I'm stuck too! :-) ...Beer Time!

again, any help would be much appreciated.

thanx,

inzo
 
Back
Top