Solved

ASP.net Change image behind button on mouse hover or click

Posted on 2013-11-19
5
398 Views
Last Modified: 2013-11-19
Hi

I have an image behind each button of my navigation menu. I want to change this image
on the mouse hover or click but am not sure how to do it.
I tried testing the following event and the code didn't even run. I need a little guidance. Thanks


    Protected Sub NavigationMenu_MenuItemClick(sender As Object, e As System.Web.UI.WebControls.MenuEventArgs) Handles NavigationMenu.MenuItemClick

Msgbox "Test"
    End Sub
0
Comment
Question by:murbro
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 39659236
a much simplier way of achiving this is javascript. Here is a snippet of code that will change images on MOuseover

http://snipplr.com/view/25950/

if you would like further explanation about OnMouseover function here is an excellent link

http://www.htmlgoodies.com/beyond/javascript/article.php/3470771
0
 

Author Comment

by:murbro
ID: 39659315
Hi

I am struggling to work out how to use the first example in my existing web form, whose code I have attached
SiteMaster.txt
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 39659348
okay heres an example with your code

<asp:MenuItem ImageUrl="~/Resources/B1.bmp" onmouseover="this.src='Resources/B2.bmp'" onmouseout="this.src='Resources/B1.bmp'" ></asp:MenuItem>
0
 

Author Closing Comment

by:murbro
ID: 39659354
Thanks very much
0
 

Author Comment

by:murbro
ID: 39659385
Hi. Thanks for that last post. I tried to use it and got the following issue:
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_28298025.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

895 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

15 Experts available now in Live!

Get 1:1 Help Now