How can you provide an alternating color scheme in a
Repeater control?
Answer Posted / rey vegafria
in UI...
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<tr bgcolor="<%#getColor()%>">
<td align="center"><%#Container.DataItem("name")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
in Source Code...
Partial Class _Default
Dim strColor As String = "#ffffff"
...
Function getColor()
If strColor = "#ffffff" Then
strColor = "#E0F4F8"
getColor = "#ffffff"
Else
strColor = "#ffffff"
getColor = "#E0F4F8"
End If
End Function
End Class
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is server transfer?
What is asp.net with mvc? : Asp.Net MVC
What is difference between Fragment Caching and Page Caching in ASP.NET?
Is asp.net easy to learn?
What is connection pooling and how to enable and disable connection pooling?
How to retrieve user name in case of Window Authentication?
Differentiate between namespace and assembly.
What is the namespace to create thread in .net?
What is custom events? How to create it?
What does mvc represent in asp.net? : asp.net mvc
What are cookies in your browser?
Which object encapsulates state or data of a user?
Describe session handling in a webfarm?
Where can I get the details on migration of existing projects using various technologies to asp.net?
how to include timer or counting time to display next page in asp.net