Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-11-19
5
Medium Priority
?
421 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:Murray Brown
[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
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 2000 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:Murray Brown
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:Murray Brown
ID: 39659354
Thanks very much
0
 

Author Comment

by:Murray Brown
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 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