473,385 Members | 1,347 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,385 software developers and data experts.

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 2113
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
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
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
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
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
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
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
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
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 =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.