changing the text to underline on mouse over in a repeater row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Um9iZXJ0IFNtaXRo?=

    changing the text to underline on mouse over in a repeater row

    Hi,
    I have a repeater control with rows in made of of link buttons so that
    they react to a click as below:


    <div>
    <ASP:Repeater id="rptUserList " runat="server"
    OnItemCommand=" rptUserList_Ite mCommand" >


    <HeaderTemplate >
    <table width="100%" style="font: 8pt verdana;
    text-align:left;">

    <tr style="backgrou nd-color:#DFA894">
    <td><b>UserId </b></td>
    <td><b>Name</b></td>
    </tr>
    </HeaderTemplate>

    <ItemTemplate >
    <tr style="backgrou nd-color:#FFECD8" >
    <td><a href= <span class="MouseOut ";
    onmouseover="cl ass='MouseOver' " ><%# DataBinder.Eval (Container.Data Item,
    "UserId")%> </span></a></td>
    <td><a href= <span class="MouseOut ";
    onmouseover="cl ass='MouseOver' ;"><%# DataBinder.Eval (Container.Data Item,
    "Name") %></span></a</td>

    </tr>
    </ItemTemplate>
    <FooterTemplate >
    </table>
    </FooterTemplate>
    </ASP:Repeater>

    I also have the following styles

    <style type="text/css" >

    .MouseOut {text-decoration:none ;}
    .MouseOver {text-decoration:unde rline;}

    </style>

    On loading the repeater control is picking up the initial class mouseout and
    displaying the text in the row without an underline, however when you
    mouseover the row it doesn't pick up the new class MouseOver, please can you
    tell me how I can change the text to underline on moving the mouse over the
    row.

    Thanks in advance
    Robert
  • Teemu Keiski

    #2
    Re: changing the text to underline on mouse over in a repeater row

    Hi,

    In the script try

    onmouseover="th is.className='M ouseOver';"

    and so on.

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP




    "Robert Smith" <RobertSmith@di scussions.micro soft.comwrote in message
    news:89F91BBB-219D-4C4D-BC7C-7893C2FAF6C9@mi crosoft.com...
    Hi,
    I have a repeater control with rows in made of of link buttons so that
    they react to a click as below:
    >
    >
    <div>
    <ASP:Repeater id="rptUserList " runat="server"
    OnItemCommand=" rptUserList_Ite mCommand" >
    >
    >
    <HeaderTemplate >
    <table width="100%" style="font: 8pt verdana;
    text-align:left;">
    >
    <tr style="backgrou nd-color:#DFA894">
    <td><b>UserId </b></td>
    <td><b>Name</b></td>
    </tr>
    </HeaderTemplate>
    >
    <ItemTemplate >
    <tr style="backgrou nd-color:#FFECD8" >
    <td><a href= <span class="MouseOut ";
    onmouseover="cl ass='MouseOver' " ><%# DataBinder.Eval (Container.Data Item,
    "UserId")%> </span></a></td>
    <td><a href= <span class="MouseOut ";
    onmouseover="cl ass='MouseOver' ;"><%# DataBinder.Eval (Container.Data Item,
    "Name") %></span></a</td>
    >
    </tr>
    </ItemTemplate>
    <FooterTemplate >
    </table>
    </FooterTemplate>
    </ASP:Repeater>
    >
    I also have the following styles
    >
    <style type="text/css" >
    >
    .MouseOut {text-decoration:none ;}
    .MouseOver {text-decoration:unde rline;}
    >
    </style>
    >
    On loading the repeater control is picking up the initial class mouseout
    and
    displaying the text in the row without an underline, however when you
    mouseover the row it doesn't pick up the new class MouseOver, please can
    you
    tell me how I can change the text to underline on moving the mouse over
    the
    row.
    >
    Thanks in advance
    Robert

    Comment

    Working...