• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

VB.NET mouseover event for an img tag to call a function to perform a task


I want to use a mouseover to swap images either on or off. That part was easy -- now on mouseover I would like for a function in my code behind to be called to perform more activity on the page. Is this possible?

This is an example of the tag I am use however the mouseover does not call that function in the code behind. I am using VB.net.

<img src="/images/ProSelHome/b-tech-solutions-on.gif" WIDTH="229" HEIGHT="25" ALT="" runat="server" onmouseover="proSelMove()" id="IMG1">

Thanks in advance!
  • 2
1 Solution
Are you trying to run server side or client side vbscript?  Sever side runs when the page loads.

If you are trying to run client side vbscript then try this:

Make sure you have these tags around your function

add VBScript to onmouseover
<img src="/images/ProSelHome/b-tech-solutions-on.gif" WIDTH="229" HEIGHT="25" ALT="" runat="server" onmouseover="VBScript:proSelMove()" id="IMG1">

Try it...

In your code-behind type the following:


Here replace 'yourfunctionName' with the name of your function.

Try it.  :-)

Hey what happened to the question ?

smBrother Plz abandon or close it or award points,if you've found the answer to your question.

Moderators plz do the needful.
smBrotherAuthor Commented:
Sorry but none of the solutions offer had worked. I was unable to use them to cause a post back with a mouse over on an img tag. Sorry for the delay in response.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now