Connecting Tech Pros Worldwide Help | Site Map

Changing color of hyperlink when mouse over it

Martha
Guest
 
Posts: n/a
#1: Nov 16 '05
When I move my mouse over a hyperlink component, the hyperlink does not
change color.

How do I change the color of a hyperlink when the mouse goes over the
hyperlink?
or
Change the color of a button component when the mouse goes over the button?

I am using Microsfot Visual c#.net Version 7.1.3008

Thanks
Angel J. Hernández M.
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Changing color of hyperlink when mouse over it


Hi there... That event happens on the client side so you need a script to
perform the action requested. You can also define a stylesheet and reference
it from the script (this allows you changing colors and appeareance of the
object without recompiling your solution). Hope this can help you.

Regards,

--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://ajhsis.net



"Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
news:144684E3-7AF4-40BB-BACA-EA375991083D@microsoft.com...[color=blue]
> When I move my mouse over a hyperlink component, the hyperlink does not
> change color.
>
> How do I change the color of a hyperlink when the mouse goes over the
> hyperlink?
> or
> Change the color of a button component when the mouse goes over the
> button?
>
> I am using Microsfot Visual c#.net Version 7.1.3008
>
> Thanks[/color]


Martha
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Changing color of hyperlink when mouse over it


I'm pretty new at this so where do I add the script ?
Do I add the scrip In the code behind section or add the script directly in
the HTML section of the Webform1.aspx?
Is there any example that shows one how to do this?
Thank you,
Martha

"Angel J. Hernández M." wrote:
[color=blue]
> Hi there... That event happens on the client side so you need a script to
> perform the action requested. You can also define a stylesheet and reference
> it from the script (this allows you changing colors and appeareance of the
> object without recompiling your solution). Hope this can help you.
>
> Regards,
>
> --
> Angel J. Hernández M.
> MCP - MCAD - MCSD - MCDBA
> http://groups.msn.com/desarrolladoresmiranda
> http://ajhsis.net
>
>
>
> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
> news:144684E3-7AF4-40BB-BACA-EA375991083D@microsoft.com...[color=green]
> > When I move my mouse over a hyperlink component, the hyperlink does not
> > change color.
> >
> > How do I change the color of a hyperlink when the mouse goes over the
> > hyperlink?
> > or
> > Change the color of a button component when the mouse goes over the
> > button?
> >
> > I am using Microsfot Visual c#.net Version 7.1.3008
> >
> > Thanks[/color]
>
>
>[/color]
Angel J. Hernández M.
Guest
 
Posts: n/a
#4: Nov 16 '05

re: Changing color of hyperlink when mouse over it


You can add it in the html section of your webform. For more information
about this topic you can check this article too.

http://msdn.microsoft.com/library/de...sidescript.asp

Regards,


--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://ajhsis.net

"Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
news:F7519181-0B42-41D6-8080-712AFD36CCC3@microsoft.com...[color=blue]
> I'm pretty new at this so where do I add the script ?
> Do I add the scrip In the code behind section or add the script directly
> in
> the HTML section of the Webform1.aspx?
> Is there any example that shows one how to do this?
> Thank you,
> Martha
>
> "Angel J. Hernández M." wrote:
>[color=green]
>> Hi there... That event happens on the client side so you need a script
>> to
>> perform the action requested. You can also define a stylesheet and
>> reference
>> it from the script (this allows you changing colors and appeareance of
>> the
>> object without recompiling your solution). Hope this can help you.
>>
>> Regards,
>>
>> --
>> Angel J. Hernández M.
>> MCP - MCAD - MCSD - MCDBA
>> http://groups.msn.com/desarrolladoresmiranda
>> http://ajhsis.net
>>
>>
>>
>> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
>> news:144684E3-7AF4-40BB-BACA-EA375991083D@microsoft.com...[color=darkred]
>> > When I move my mouse over a hyperlink component, the hyperlink does not
>> > change color.
>> >
>> > How do I change the color of a hyperlink when the mouse goes over the
>> > hyperlink?
>> > or
>> > Change the color of a button component when the mouse goes over the
>> > button?
>> >
>> > I am using Microsfot Visual c#.net Version 7.1.3008
>> >
>> > Thanks[/color]
>>
>>
>>[/color][/color]


Martha
Guest
 
Posts: n/a
#5: Nov 16 '05

re: Changing color of hyperlink when mouse over it


Hi Angel,
Finally figured it out:
For a hyperlink - to change the color when mouse moves over the hyperlink:

<asp:HyperLink id="HyperLink4" runat="server" BorderStyle="None"
NavigateUrl="http://www.cnn.com"
BorderWidth="0px"
onmouseover="this.style.backgroundColor='yellow'"
onmouseout="this.style.backgroundColor='green'"[color=blue]
>HyperLink</asp:HyperLink>[/color]
I think there is another way to add the same code but in the code behind
section by using attributes but at this point, I am not sure how to do it.
In any case it works for now.
Thank you,
Martha


"Angel J. Hernández M." wrote:
[color=blue]
> You can add it in the html section of your webform. For more information
> about this topic you can check this article too.
>
> http://msdn.microsoft.com/library/de...sidescript.asp
>
> Regards,
>
>
> --
> Angel J. Hernández M.
> MCP - MCAD - MCSD - MCDBA
> http://groups.msn.com/desarrolladoresmiranda
> http://ajhsis.net
>
> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
> news:F7519181-0B42-41D6-8080-712AFD36CCC3@microsoft.com...[color=green]
> > I'm pretty new at this so where do I add the script ?
> > Do I add the scrip In the code behind section or add the script directly
> > in
> > the HTML section of the Webform1.aspx?
> > Is there any example that shows one how to do this?
> > Thank you,
> > Martha
> >
> > "Angel J. Hernández M." wrote:
> >[color=darkred]
> >> Hi there... That event happens on the client side so you need a script
> >> to
> >> perform the action requested. You can also define a stylesheet and
> >> reference
> >> it from the script (this allows you changing colors and appeareance of
> >> the
> >> object without recompiling your solution). Hope this can help you.
> >>
> >> Regards,
> >>
> >> --
> >> Angel J. Hernández M.
> >> MCP - MCAD - MCSD - MCDBA
> >> http://groups.msn.com/desarrolladoresmiranda
> >> http://ajhsis.net
> >>
> >>
> >>
> >> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
> >> news:144684E3-7AF4-40BB-BACA-EA375991083D@microsoft.com...
> >> > When I move my mouse over a hyperlink component, the hyperlink does not
> >> > change color.
> >> >
> >> > How do I change the color of a hyperlink when the mouse goes over the
> >> > hyperlink?
> >> > or
> >> > Change the color of a button component when the mouse goes over the
> >> > button?
> >> >
> >> > I am using Microsfot Visual c#.net Version 7.1.3008
> >> >
> >> > Thanks
> >>
> >>
> >>[/color][/color]
>
>
>[/color]
Angel J. Hernández M.
Guest
 
Posts: n/a
#6: Nov 16 '05

re: Changing color of hyperlink when mouse over it


It's ok... Happy programming ;-)


--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://ajhsis.net

"Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
news:F068BD31-3493-44A7-9CAB-458621E21776@microsoft.com...[color=blue]
> Hi Angel,
> Finally figured it out:
> For a hyperlink - to change the color when mouse moves over the hyperlink:
>
> <asp:HyperLink id="HyperLink4" runat="server" BorderStyle="None"
> NavigateUrl="http://www.cnn.com"
> BorderWidth="0px"
> onmouseover="this.style.backgroundColor='yellow'"
> onmouseout="this.style.backgroundColor='green'"[color=green]
> >HyperLink</asp:HyperLink>[/color]
> I think there is another way to add the same code but in the code behind
> section by using attributes but at this point, I am not sure how to do it.
> In any case it works for now.
> Thank you,
> Martha
>
>
> "Angel J. Hernández M." wrote:
>[color=green]
>> You can add it in the html section of your webform. For more information
>> about this topic you can check this article too.
>>
>> http://msdn.microsoft.com/library/de...sidescript.asp
>>
>> Regards,
>>
>>
>> --
>> Angel J. Hernández M.
>> MCP - MCAD - MCSD - MCDBA
>> http://groups.msn.com/desarrolladoresmiranda
>> http://ajhsis.net
>>
>> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
>> news:F7519181-0B42-41D6-8080-712AFD36CCC3@microsoft.com...[color=darkred]
>> > I'm pretty new at this so where do I add the script ?
>> > Do I add the scrip In the code behind section or add the script
>> > directly
>> > in
>> > the HTML section of the Webform1.aspx?
>> > Is there any example that shows one how to do this?
>> > Thank you,
>> > Martha
>> >
>> > "Angel J. Hernández M." wrote:
>> >
>> >> Hi there... That event happens on the client side so you need a
>> >> script
>> >> to
>> >> perform the action requested. You can also define a stylesheet and
>> >> reference
>> >> it from the script (this allows you changing colors and appeareance of
>> >> the
>> >> object without recompiling your solution). Hope this can help you.
>> >>
>> >> Regards,
>> >>
>> >> --
>> >> Angel J. Hernández M.
>> >> MCP - MCAD - MCSD - MCDBA
>> >> http://groups.msn.com/desarrolladoresmiranda
>> >> http://ajhsis.net
>> >>
>> >>
>> >>
>> >> "Martha" <Martha@discussions.microsoft.com> escribió en el mensaje
>> >> news:144684E3-7AF4-40BB-BACA-EA375991083D@microsoft.com...
>> >> > When I move my mouse over a hyperlink component, the hyperlink does
>> >> > not
>> >> > change color.
>> >> >
>> >> > How do I change the color of a hyperlink when the mouse goes over
>> >> > the
>> >> > hyperlink?
>> >> > or
>> >> > Change the color of a button component when the mouse goes over the
>> >> > button?
>> >> >
>> >> > I am using Microsfot Visual c#.net Version 7.1.3008
>> >> >
>> >> > Thanks
>> >>
>> >>
>> >>[/color]
>>
>>
>>[/color][/color]


Closed Thread