473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

underlining a row in a repeater control

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>

Jun 27 '08 #1
2 2132
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" <Ro*********@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...
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>

Jun 27 '08 #2
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>
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
3
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
7
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
4
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString;...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
12
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.