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 side routing?
What's the use of formatters in .net?
Where is the view state data stored?
What is asp.net version?
What is protected configuration?
Where sessions are stored in asp.net?
Define session in asp.net.
What is the size of Get method and how much data it can store?
I have an external link in my application say www.xyztest.com. Today this site works on http protocal. Tommorow it may run on https. So i cant hardcore the protocal in the site. When a user clicks on the link how can i know if the external site works on http or https and takes him to that place?
Is asp.net web forms dead?
What is globalization and localization in asp net?
What is bound controls
What is the differences between a primary key and a unique key in sql server?
Can you explain how ASP.NET application life cycle and page life cycle events fire?
How can we inherit a static variable?