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
Solved

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

Posted on 2003-11-21
4
634 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

How our DevOps Teams Maximize Uptime

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

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
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.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

792 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