Solved

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

Posted on 2003-11-21
4
641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

688 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