Solved

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

Posted on 2013-11-19
5
396 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

12 Experts available now in Live!

Get 1:1 Help Now