469,926 Members | 1,717 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

making image click fire codebehind function?

have an image (acting like a button) currently that has onMouseOver
and onMouseOut events. want to make this accessible to the codebehind
with a click event.
was able to right click at and choose "run as server control", when i
double click it then to put code in the codebehind, there is no
function there for me to fill in. i made up one called goButton_Click
and handles gobutton.click
that didn't work, didn't recognize the name i gave it or click event
(don't remember which).
if i was to change it to a vb.net imagebutton, then i'd loose the
onMouseOver and onMouseOut events.

is there a way to have an image have the onMouse events and upon
clicking be handled by a codebehind function? i'm sure there is,
seems like a pretty standard process, just haven't put the pieces
together yet. ugh
(this is in a user control, ascx, by the way)

thanks for any help and an example would be great!

Feb 5 '06 #1
4 1807
Simon,

It is easier to use Image Buttons for this kind of things.

You only have to know it.

I hope this helps,

Cor
Feb 5 '06 #2
thanks, i think i tried that, not sure been trying so many new things
lately. but one of the issues with using something like that was that
i was not sure how to give the onMouse commands within the tag. lots
of squigglies come up if i'm not mistaken, which makes me a little
nervous to see them in the code
Simon,

It is easier to use Image Buttons for this kind of things.

You only have to know it.

I hope this helps,

Cor


Feb 5 '06 #3
Hi,

Not sure if this the best method but you can use ajax to call a
function in the code behind with javascript.

http://www.vb-tips.com/default.aspx?...d-73214b27750c

Ken
--------------------------------

"simon" wrote:
thanks, i think i tried that, not sure been trying so many new things
lately. but one of the issues with using something like that was that
i was not sure how to give the onMouse commands within the tag. lots
of squigglies come up if i'm not mistaken, which makes me a little
nervous to see them in the code
Simon,

It is easier to use Image Buttons for this kind of things.

You only have to know it.

I hope this helps,

Cor


Feb 5 '06 #4
Simon,

You can add to every control attributes using VBNet.

http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

I hope this helps,

Cor

"simon" <me@here.com> schreef in bericht
news:l2********************************@4ax.com...
thanks, i think i tried that, not sure been trying so many new things
lately. but one of the issues with using something like that was that
i was not sure how to give the onMouse commands within the tag. lots
of squigglies come up if i'm not mistaken, which makes me a little
nervous to see them in the code
Simon,

It is easier to use Image Buttons for this kind of things.

You only have to know it.

I hope this helps,

Cor

Feb 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Epetruk | last post: by
reply views Thread by H Branyan | last post: by
3 posts views Thread by Simon Harris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.