Home > ASP.Net > Highlight Row on MouseOver in Repeater Control

Highlight Row on MouseOver in Repeater Control


Hi

try this example to Highlight Row on MouseOver in Repeater or DataList Control

<%@ Page Language="vb" Src="HighlightRepeater.aspx.vb" Inherits="HighlightRepeater"%>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 <head>
 <title>Highlight Repeater Row</title>
 </head>
 <body>
 <table width="50%">
   <tr>
     <td bgcolor="black" align="center"><font color="white"><b>Customer Data</b></font></td>
   </tr>
 </table>
 <form id="Form1" method="post" runat="server">
  <asp:Repeater ID="Repeater1" Runat="server">
   <HeaderTemplate>
     <table width="50%" cellspacing="0" cellpadding="0">
       <tr>
         <td bgcolor="black" align="left"><font color="white"><b>Customer ID</b></font></td>
         <td bgcolor="black" align="left"><font color="white"><b>Company Name</b></font></td>
         <td bgcolor="black" align="left"><font color="white"><b>Contact Name</b></font></td>
       </tr>
   </HeaderTemplate>
   <ItemTemplate>
       <a href="ShowCust.aspx?id=<%# Container.DataItem("CustomerID") %>">
       <tr style="cursor:hand" onmouseover="style.backgroundColor='LightBlue'" onmouseout="style.backgroundColor=''">
         <td align="left"><%# Container.DataItem("CustomerID") %></td>
         <td align="left"><%# Container.DataItem("CompanyName") %></td>
         <td align="left"><%# Container.DataItem("ContactName") %></td>
       </tr>
       </a>
   </ItemTemplate>
   <FooterTemplate>
     </table>
   </FooterTemplate>
 </asp:Repeater>
 </form>
 </body>
 </html>

Hope this helps

Good Luck

Advertisements
Categories: ASP.Net
  1. Reda Abbas
    October 9, 2009 at 7:44 pm

    Eih ya 3am el Kalam el gamed dah.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: