Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > underlining a row in a repeater control

Reply
Thread Tools

underlining a row in a repeater control

 
 
Robert Smith
Guest
Posts: n/a
 
      06-19-2008
Hi I have a repeater control as shown below. The Itemtemplate contains a
table with linkbuttons in each column of the row. However I wish to change
the stlyle of the link button to
text-decoration:underline on mouseover and
text-decoration:none on mouseout

The link button does not have a mouseover attribute and it won't let me add on
Any idea how I can get around this problem.

Thanx in advance
Robert


<ASP:Repeater id="MyRepeater" runat="server" >

<ItemTemplate >
<tr style="width:100%;background-color:FFECD8;" >
<td >
<asp:LinkButton id="lnkPages" style="text-decoration:none"
runat="server" value='<%# DataBinder.Eval(Container.DataItem, "UserId")%>'
Text = '<%# DataBinder.Eval(Container.DataItem, "UserId")%>'></asp:LinkButton>
</td>
<td>
<asp:LinkButton id="LinkButton1" style="text-decoration:none"
runat="server" value='<%# DataBinder.Eval(Container.DataItem, "UserName")%>'
Text = '<%# DataBinder.Eval(Container.DataItem,
"UserName")%>'></asp:LinkButton>
</td>
<td>
<asp:LinkButton id="LinkButton2" style="text-decoration:none"
runat="server" value='<%# DataBinder.Eval(Container.DataItem, "FirstName")%>'
Text = '<%# DataBinder.Eval(Container.DataItem,
"FirstName")%>'></asp:LinkButton>
</td>
<td>
<asp:LinkButton id="LinkButton3" style="text-decoration:none"
runat="server" value='<%# DataBinder.Eval(Container.DataItem, "LastName")%>'
Text = '<%# DataBinder.Eval(Container.DataItem,
"LastName")%>'></asp:LinkButton>
</td>
</tr>

</ItemTemplate>

<FooterTemplate>

</table>

</FooterTemplate>

</ASP:Repeater>

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-19-2008
Add onmouseover and onmouseout attributes and ignore validation errors:
onmouseover="this.style.textDecoration='underline' ";
onmouseout ="this.style.textDecoration='none'";

If the validation errors anoy you too much, add the attributes in the code
in any of these events: ItemCreated, ItemDataBound, PreRender:
myLinkButton.Attributes["onmouseover "] =
"this.style.textDecoration='underline'";
myLinkButton.Attributes["onmouseout "] = "this.style.textDecoration='none'";

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Robert Smith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi I have a repeater control as shown below. The Itemtemplate contains a
> table with linkbuttons in each column of the row. However I wish to change
> the stlyle of the link button to
> text-decoration:underline on mouseover and
> text-decoration:none on mouseout
>
> The link button does not have a mouseover attribute and it won't let me
> add on
> Any idea how I can get around this problem.
>
> Thanx in advance
> Robert
>
>
> <ASP:Repeater id="MyRepeater" runat="server" >
>
> <ItemTemplate >
> <tr style="width:100%;background-color:FFECD8;" >
> <td >
> <asp:LinkButton id="lnkPages" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem, "UserId")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "UserId")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton1" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem,
> "UserName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "UserName")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton2" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem,
> "FirstName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "FirstName")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton3" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem,
> "LastName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "LastName")%>'></asp:LinkButton>
> </td>
> </tr>
>
> </ItemTemplate>
>
> <FooterTemplate>
>
> </table>
>
> </FooterTemplate>
>
> </ASP:Repeater>
>



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      06-19-2008
no javascript required, just use css:

a:hover {text-decoration:underline; }

-- bruce (sqlwork.com)


"Robert Smith" wrote:

> Hi I have a repeater control as shown below. The Itemtemplate contains a
> table with linkbuttons in each column of the row. However I wish to change
> the stlyle of the link button to
> text-decoration:underline on mouseover and
> text-decoration:none on mouseout
>
> The link button does not have a mouseover attribute and it won't let me add on
> Any idea how I can get around this problem.
>
> Thanx in advance
> Robert
>
>
> <ASP:Repeater id="MyRepeater" runat="server" >
>
> <ItemTemplate >
> <tr style="width:100%;background-color:FFECD8;" >
> <td >
> <asp:LinkButton id="lnkPages" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem, "UserId")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem, "UserId")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton1" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem, "UserName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "UserName")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton2" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem, "FirstName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "FirstName")%>'></asp:LinkButton>
> </td>
> <td>
> <asp:LinkButton id="LinkButton3" style="text-decoration:none"
> runat="server" value='<%# DataBinder.Eval(Container.DataItem, "LastName")%>'
> Text = '<%# DataBinder.Eval(Container.DataItem,
> "LastName")%>'></asp:LinkButton>
> </td>
> </tr>
>
> </ItemTemplate>
>
> <FooterTemplate>
>
> </table>
>
> </FooterTemplate>
>
> </ASP:Repeater>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox and Underlining Joe Firefox 2 03-30-2006 02:22 AM
Checkbox and dropdownlist row in repeater row =?Utf-8?B?UmljaGFyZEg=?= ASP .Net 2 03-24-2006 10:48 AM
FF1.04 underlining urls Wygtya Firefox 3 06-16-2005 11:36 AM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
underlining on websites =?Utf-8?B?a21uZXdidXJu?= Microsoft Certification 2 05-25-2004 05:31 PM



Advertisments