473,485 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RollOver and onMouseOver?

I'm using .NET v1.1 with ASPX web page.

I'm trying to have a RollOver hyperlink that will change images on an image
control and update the text in a Label control. I've got the image swapping
working, however I don't know how to get my Label control text to change
with the onMouseOver event

HTML...

</asp:hyperlink><asp:hyperlink id="lnkImageS" style="Z-INDEX: 113; LEFT:
92px; POSITION: absolute; TOP: 94px" runat="server"
Width="59px" Height="103px">
<asp:Image runat="server" Width="59px" ID="Image1" Height="103px"
ImageUrl="Graphics/SizeDiagrams_03.jpg"
style="Z-INDEX: 113; LEFT: 6px; POSITION: absolute; TOP:
92px"></asp:Image>

Page_Load...

im_XS.ImageUrl = "Graphics/SizeDiagrams_03.jpg"
im_XS.Attributes.Add("name", im_XS.ClientID)
lnkImageXS.NavigateUrl = "#"
lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over Image';
return true;")
lnkImageXS.Attributes.Add("onMouseOut", im_XS.ClientID &
".src='Graphics/SizeDiagrams_03.jpg'; window.status=' '; return true;")

What I would like in an onMouseOver that will let me change the image AND
change the text of a Label control -- any suggestions?

Rob.
Jan 13 '06 #1
4 2119
Rob,

lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over Image';
return true;document.getElementById('" & MyLabel.ClientId & "').innerHtml =
'Mouse Over Text';")
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
I'm using .NET v1.1 with ASPX web page.

I'm trying to have a RollOver hyperlink that will change images on an
image control and update the text in a Label control. I've got the image
swapping working, however I don't know how to get my Label control text to
change with the onMouseOver event

HTML...

</asp:hyperlink><asp:hyperlink id="lnkImageS" style="Z-INDEX: 113; LEFT:
92px; POSITION: absolute; TOP: 94px" runat="server"
Width="59px" Height="103px">
<asp:Image runat="server" Width="59px" ID="Image1" Height="103px"
ImageUrl="Graphics/SizeDiagrams_03.jpg"
style="Z-INDEX: 113; LEFT: 6px; POSITION: absolute; TOP:
92px"></asp:Image>

Page_Load...

im_XS.ImageUrl = "Graphics/SizeDiagrams_03.jpg"
im_XS.Attributes.Add("name", im_XS.ClientID)
lnkImageXS.NavigateUrl = "#"
lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;")
lnkImageXS.Attributes.Add("onMouseOut", im_XS.ClientID &
".src='Graphics/SizeDiagrams_03.jpg'; window.status=' '; return true;")

What I would like in an onMouseOver that will let me change the image AND
change the text of a Label control -- any suggestions?

Rob.

Jan 13 '06 #2
Justin,

This didn't work? my ASP.NET Label1 (in your sample this is MyLabel)
control still shows "Label" when I mouse over the lnkImageXS -- you could
should make the Label1 display "Mouse Over Text" right?

Rob.
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:uJ**************@TK2MSFTNGP10.phx.gbl...
Rob,

lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;document.getElementById('" & MyLabel.ClientId &
"').innerHtml = 'Mouse Over Text';")
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
I'm using .NET v1.1 with ASPX web page.

I'm trying to have a RollOver hyperlink that will change images on an
image control and update the text in a Label control. I've got the image
swapping working, however I don't know how to get my Label control text
to change with the onMouseOver event

HTML...

</asp:hyperlink><asp:hyperlink id="lnkImageS" style="Z-INDEX: 113;
LEFT: 92px; POSITION: absolute; TOP: 94px" runat="server"
Width="59px" Height="103px">
<asp:Image runat="server" Width="59px" ID="Image1" Height="103px"
ImageUrl="Graphics/SizeDiagrams_03.jpg"
style="Z-INDEX: 113; LEFT: 6px; POSITION: absolute; TOP:
92px"></asp:Image>

Page_Load...

im_XS.ImageUrl = "Graphics/SizeDiagrams_03.jpg"
im_XS.Attributes.Add("name", im_XS.ClientID)
lnkImageXS.NavigateUrl = "#"
lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;")
lnkImageXS.Attributes.Add("onMouseOut", im_XS.ClientID &
".src='Graphics/SizeDiagrams_03.jpg'; window.status=' '; return true;")

What I would like in an onMouseOver that will let me change the image AND
change the text of a Label control -- any suggestions?

Rob.


Jan 13 '06 #3
Rob,

Yes, but I didn't test this code. Instead of innerHTML you may want to try
some of the other possibilties like innerText and innerContent.

But one of these methods is the way to do it. If I get a bit of time in a
little while this morning (my six year old wants to play) I'll test this and
figure out which one will work for certain.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Justin,

This didn't work? my ASP.NET Label1 (in your sample this is MyLabel)
control still shows "Label" when I mouse over the lnkImageXS -- you could
should make the Label1 display "Mouse Over Text" right?

Rob.
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote
in message news:uJ**************@TK2MSFTNGP10.phx.gbl...
Rob,

lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;document.getElementById('" & MyLabel.ClientId &
"').innerHtml = 'Mouse Over Text';")
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
I'm using .NET v1.1 with ASPX web page.

I'm trying to have a RollOver hyperlink that will change images on an
image control and update the text in a Label control. I've got the
image swapping working, however I don't know how to get my Label control
text to change with the onMouseOver event

HTML...

</asp:hyperlink><asp:hyperlink id="lnkImageS" style="Z-INDEX: 113;
LEFT: 92px; POSITION: absolute; TOP: 94px" runat="server"
Width="59px" Height="103px">
<asp:Image runat="server" Width="59px" ID="Image1" Height="103px"
ImageUrl="Graphics/SizeDiagrams_03.jpg"
style="Z-INDEX: 113; LEFT: 6px; POSITION: absolute; TOP:
92px"></asp:Image>

Page_Load...

im_XS.ImageUrl = "Graphics/SizeDiagrams_03.jpg"
im_XS.Attributes.Add("name", im_XS.ClientID)
lnkImageXS.NavigateUrl = "#"
lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;")
lnkImageXS.Attributes.Add("onMouseOut", im_XS.ClientID &
".src='Graphics/SizeDiagrams_03.jpg'; window.status=' '; return true;")

What I would like in an onMouseOver that will let me change the image
AND change the text of a Label control -- any suggestions?

Rob.



Jan 14 '06 #4
Rob,

I just noticed something. Since I just copied and pasted your code and
tacked on the document.getElement... at the end I didn't see your "return
true". You'll of course have to move the return true to the end of the
javascripts that are fired. Did you do that?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Justin,

This didn't work? my ASP.NET Label1 (in your sample this is MyLabel)
control still shows "Label" when I mouse over the lnkImageXS -- you could
should make the Label1 display "Mouse Over Text" right?

Rob.
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote
in message news:uJ**************@TK2MSFTNGP10.phx.gbl...
Rob,

lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;document.getElementById('" & MyLabel.ClientId &
"').innerHtml = 'Mouse Over Text';")
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
I'm using .NET v1.1 with ASPX web page.

I'm trying to have a RollOver hyperlink that will change images on an
image control and update the text in a Label control. I've got the
image swapping working, however I don't know how to get my Label control
text to change with the onMouseOver event

HTML...

</asp:hyperlink><asp:hyperlink id="lnkImageS" style="Z-INDEX: 113;
LEFT: 92px; POSITION: absolute; TOP: 94px" runat="server"
Width="59px" Height="103px">
<asp:Image runat="server" Width="59px" ID="Image1" Height="103px"
ImageUrl="Graphics/SizeDiagrams_03.jpg"
style="Z-INDEX: 113; LEFT: 6px; POSITION: absolute; TOP:
92px"></asp:Image>

Page_Load...

im_XS.ImageUrl = "Graphics/SizeDiagrams_03.jpg"
im_XS.Attributes.Add("name", im_XS.ClientID)
lnkImageXS.NavigateUrl = "#"
lnkImageXS.Attributes.Add("onMouseOver", im_XS.ClientID &
".src='Graphics/SizeDiagramsRoll_03.jpg'; window.status='Mouse Over
Image'; return true;")
lnkImageXS.Attributes.Add("onMouseOut", im_XS.ClientID &
".src='Graphics/SizeDiagrams_03.jpg'; window.status=' '; return true;")

What I would like in an onMouseOver that will let me change the image
AND change the text of a Label control -- any suggestions?

Rob.



Jan 14 '06 #5

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

Similar topics

2
1994
by: Koh | last post by:
My rollover image effect work fine in Netscape but not in Internet Explorer. Is there any important element or tag that I have miss out so it is not working in Internet Explorer? Below is my code,...
9
2023
by: Karl Burrows | last post by:
I am working on a Website for a non-profit group and for some reason I have one link that doesn't want to cooperate. All the image links work fine with the onmouseover and onmouseout script except...
4
1573
by: Matt | last post by:
i know more-or-less zero about javascript, but my client wants a rollover and he created this code, which doesn't work. All comments are appreciated. 1. the tag: <td align="center" width="66"...
3
2688
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on...
2
2785
by: Rob Roberts | last post by:
I am trying to figure out a way to add onmouseover and onmouseout events to ButtonFields in a GridView in order to give them a rollover effect, but so far I haven't been able to figure out a way to...
2
2097
by: the other john | last post by:
I am looking for ideas on how to create a rollover that triggers an image rotation in another location. I know how to create a function for basic rollovers, image swapping sort of thing, but I...
1
2273
by: Jim in Arizona | last post by:
using ASP.NET/VB.NET 2.0 I can change the text color of an ASP Button object on mouse rollover/rollout by doing this (in page_load) btnMyButton.Attributes.Add("onmouseover",...
3
2718
by: Oriane | last post by:
Hi there, I would like to handle a "rollover" <asp:Buttonin the code behind with C# with this kind of code: Button btn = Page.FindControl("Button" + numWidget) as Button; btn.Attributes =...
0
6960
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
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7161
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...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5418
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,...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
247
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.