Solved

MouseOver Effects using ASP.NET

Posted on 2004-04-19
8
732 Views
Last Modified: 2012-08-13
Hi how do you do mouseover effect on a button in a form?

When you put ur mouse over the button image (but1.gif), I want it to change to another button image (but2.gif). I tried onmouseover, but ASP.NET doesnt recognise it.

My current code is:

<asp:ImageButton OnClick="SubmitHandler" Runat="server" BorderWidth="0" ImageUrl="but1.gif" />

How should I manipulate it so it does the mouseover effect?
0
Comment
Question by:bchia
[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
8 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 10857820
add ID attribute to your ImageButton, for example ID="ImageOnMouseOver"

in your code behind
use this

ImageOnMouseOver.Attributes.Add ("onmouseover", "yourjavascript code" )

B..M

0
 
LVL 8

Expert Comment

by:Dishan Fernando
ID: 10857826
You must do it through java script
0
 

Author Comment

by:bchia
ID: 10857841
Thanks heaps :)

I did what u said.. Only one more problem..
What would the javascript code be for changing image, for example, from but1.gif to but2.gif?

0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 28

Accepted Solution

by:
mmarinov earned 20 total points
ID: 10857849
<script language=javascript>
 function changeimage(src)
 {
  imagebuttonname.src = src;
 }
</script>

B..M
0
 
LVL 8

Expert Comment

by:Dishan Fernando
ID: 10857856
0
 
LVL 6

Expert Comment

by:zulu_11
ID: 10859111
in addition to the code given by mmarinov..add another similar code for onMouseOut so that when the mouse moves away from the button , it gets back to the original image..

Zulu
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why use this lambda? 12 95
vb.net convert long time to mm:ss 23 34
I need help adding validation to my MVC.Net view 6 36
CSS question 16 63
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 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