Solved

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

Posted on 2003-11-21
4
630 Views
Last Modified: 2010-05-18
Hello,

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!
0
Comment
Question by:smBrother
  • 2
4 Comments
 
LVL 10

Expert Comment

by:D_M_D
ID: 9802692
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
<SCRIPT LANGUAGE="VBScript"></SCRIPT>

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...

--------
D_M_D
0
 
LVL 1

Accepted Solution

by:
vinayakrishna earned 250 total points
ID: 9816685
In your code-behind type the following:

IMG1.Attributes.Add("onmouseover","yourfunctionName();")

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


Try it.  :-)

Viky
0
 
LVL 1

Expert Comment

by:vinayakrishna
ID: 9857001
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.
0
 

Author Comment

by:smBrother
ID: 9858150
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.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question