Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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