473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

can you add onMouseOver/onMouseOut to an ImageButton??

hello. have an image button that i'd like to add some onMouseOver/Out
to an imageButton.

line looks like this...
<asp:ImageButton onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('go','','images/go_on.gif',1)"
ID="headerSearchButton" runat="server" Width="27" Height="20"
ImageUrl="http://localhost/App1/images/go_off.gif"></asp:ImageButton>

the onMouseOver/Out both have the squiggly lines under them in VS
(using 2003 by the way). which in some cases you can ignore when you
build the project and things sometimes work in the browser after the
compile. but in the case the mouse functions are not working.

is this possible, if so and this syntax is not correct, what would the
correct syntax be?

thanks

Feb 10 '06 #1
6 8293
Simon,

In my opinon is th OnClick event disapeared from your button. Did you do
this direct in MacroMedia?

Cor
Feb 10 '06 #2
simon wrote:
hello. have an image button that i'd like to add some onMouseOver/Out
to an imageButton.


I think you want the .Attributes property, e.g. from the help:-
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

Andrew
Feb 10 '06 #3
Hello Cor, i'm sorry, but i don't follow what you are saying? what i
was looking to do was onMouseOver/onMouseOut to an imagebutton. forced
those parm into the tag on the HTML side, but neither were
called/executed after compiling and running the project/app in the
browser. not sure what you are referring to about MacroMedia, this
was all written in VisualStudio 2003.
thanks for the reply, sorry i didn't get what you were asking...
In my opinon is th OnClick event disapeared from your button. Did you do
this direct in MacroMedia?

Feb 10 '06 #4
Andrew, thanks. i believe this is what i was looking for. will read
more about this today. thanks again!
simon wrote:
hello. have an image button that i'd like to add some onMouseOver/Out
to an imageButton.


I think you want the .Attributes property, e.g. from the help:-
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

Andrew


Feb 10 '06 #5
Simon,
browser. not sure what you are referring to about MacroMedia, this
was all written in VisualStudio 2003.


Maybe but you have probably used (knowing or not knowing it), code from
(maybe changed however based on) MacroMedia, in Net you cannot set the
mouse-over on the client side with the developer. Beneath is a standard
image button description in Net, which has no standard property for
OnMouseOut or/and for OnmouseOver. (You can set it as is showed by Andrew,
although you have than still to add the JavaScript).

<asp:ImageButton id="ImageButton1" style="Z-INDEX: 101; LEFT: 448px;
POSITION: absolute; TOP: 136px" runat="server"></asp:ImageButton>

MacroMedia prefixes all its javascript methods with MM_ as is in your code
which I show you beneath again. With the method there has to be a piece of
JavaScript that process those codes.

<asp:ImageButton onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('go','','images/go_on.gif',1)"
ID="headerSearchButton" runat="server" Width="27" Height="20"
ImageUrl="http://localhost/App1/images/go_off.gif"></asp:ImageButton>

I don't see an On Click in it, by the Net code is it with all buttons done
with the runat="server" (for other controls do you have to force that). You
don't have that runat="server" in your code.

I hope this helps,

Cor

Feb 10 '06 #6
I see what you are saying now. we hired a contractor to do some of
the graphical makeup to a site we are building, which included some
javascript references. so they must have used marcomedia to create
some of the javascript controls.
if i convert the images/buttons to .net objects, then i will add the
runat=server to them. thanks for the reminder!
that has been most of my issues latest is trying to get the html stubs
they provided back to us into the .net app we're building (that plus
i'm brand new to .net, so everything is a learning experience for me)
i appreciate all the replies and tips from all you guys
thanks again!

Simon,
browser. not sure what you are referring to about MacroMedia, this
was all written in VisualStudio 2003.


Maybe but you have probably used (knowing or not knowing it), code from
(maybe changed however based on) MacroMedia, in Net you cannot set the
mouse-over on the client side with the developer. Beneath is a standard
image button description in Net, which has no standard property for
OnMouseOut or/and for OnmouseOver. (You can set it as is showed by Andrew,
although you have than still to add the JavaScript).

<asp:ImageButton id="ImageButton1" style="Z-INDEX: 101; LEFT: 448px;
POSITION: absolute; TOP: 136px" runat="server"></asp:ImageButton>

MacroMedia prefixes all its javascript methods with MM_ as is in your code
which I show you beneath again. With the method there has to be a piece of
JavaScript that process those codes.

<asp:ImageButton onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('go','','images/go_on.gif',1)"
ID="headerSearchButton" runat="server" Width="27" Height="20"
ImageUrl="http://localhost/App1/images/go_off.gif"></asp:ImageButton>

I don't see an On Click in it, by the Net code is it with all buttons done
with the runat="server" (for other controls do you have to force that). You
don't have that runat="server" in your code.

I hope this helps,

Cor


Feb 11 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: laurie | last post by:
Hi. I have a DIV section that has many thumbnail images inside it. I have a DIV so all images can fit in a row and the horizontal scroll bar is used to move the thumbnails from left to right. ...
2
by: Jay | last post by:
I have an imagebutton like so: <asp:ImageButton onmouseover="this.src='lc.gif';" onmouseout="this.src='nc.gif';" id="ImageButton1" runat="server" ImageUrl="nc.gif"...
2
by: Bendik Engebretsen | last post by:
Hi, ASP.NET newbie has just started expermenting with VS.NET 2005 Beta, ASP.NET 2.0 and the 'Personal WEB site' starter kit. I am now trying to create a rollover effect on the buttons. I have...
3
by: Rob Roberts | last post by:
I'm using .NET 2.0 and C# on a web site, and I'm trying to use the onmouseover and onmouseout events to do a rollover effect on an asp.net button. I've tried manually adding the events to the...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
3
by: oopaevah | last post by:
I have written some dom code to create a list of divs, each with it's own id. I want to set the onmouseover and onmouseout events to highlight the div when the mouse is over it. However I cannot...
2
by: Daz | last post by:
Hi everyone. I think my problem is a simple one, but I am completely baffled as to how to pull it off. I have a piece of code like so... document.write( "<img id=\"slideshow_toggle\"...
4
by: bgold12 | last post by:
Hey, I have kind of a weird problem. I have a span that I'm intentionally overflowing a table cell (<td>), so that it stretches over the table cells to the right of the parent table cell. I want...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.