Solved

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

Posted on 2003-11-21
4
623 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now