Onmouseover

Discussion in 'ASP .Net' started by Leon, Jun 3, 2010.

  1. Leon

    Leon Guest

    Hi evrybody.

    I have a hyperlink that I add to my webpage dynamically (in my code). I need
    it to be underlined only when user hovers over it.
    I put in my code:
    MyHyperLink.Font.Underline = False

    and thought something like:
    MyHyperLink.Attributes.Add("onmouseover", "this.Font.Underline=True")
    would work for me.
    But it does not work for me.
    What would be the correct syntax?

    Thank you.
     
    Leon, Jun 3, 2010
    #1
    1. Advertising

  2. Leon wrote:
    > I have a hyperlink that I add to my webpage dynamically (in my code).
    > I need it to be underlined only when user hovers over it.
    > I put in my code:
    > MyHyperLink.Font.Underline = False
    >
    > and thought something like:
    > MyHyperLink.Attributes.Add("onmouseover", "this.Font.Underline=True")
    > would work for me.
    > But it does not work for me.
    > What would be the correct syntax?


    In onmouseover, you're working client-side in Javascript, so

    onmouseover="this.style.textDecoration='underline'"

    --
    Andrew
     
    Andrew Morton, Jun 4, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tor Inge Rislaa
    Replies:
    3
    Views:
    16,163
    Jerry III
    Aug 6, 2003
  2. Jay
    Replies:
    2
    Views:
    41,835
    Alex Papadimoulis
    Sep 30, 2003
  3. Frances Valdes

    Onmouseover

    Frances Valdes, Mar 2, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    800
    Frances Valdes
    Mar 3, 2004
  4. =?Utf-8?B?QXZpIFNoaWxvbg==?=

    OnMouseOver for a DataGrid control

    =?Utf-8?B?QXZpIFNoaWxvbg==?=, Jul 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,208
    Mr. Dot Net
    Jul 12, 2004
  5. Ryan Moore

    DataList <td onMouseOver>

    Ryan Moore, Oct 11, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,310
    Eliyahu Goldin
    Oct 12, 2004
Loading...

Share This Page