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 a form tag?
When cookie will expire?
Do you support digital rights management to protect my videos?
What are the media types of http requests and response?
What is the difference between page directive include and action tag include?
Define what is razor? : asp.net mvc
Explain asp.net web forms.
What is web api vs wcf?
Why do we need a web application session?
Is session server side or client side?
How to implement globalization and localization in the use interface in .net.
If you want to write your own dot net language, what steps you will you take care?
What is applicatio domain?
Define cookie.
How do you implement sql caching in asp.net?