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 the parent class of all the web server control?
What is the good practice to implement validations in aspx page?
What is a session in asp.net?
What is server redirect?
Define repository pattern in mvc.net? : asp.net mvc
What is difference between asp state management and asp.net state management?
What is the difference between pathparam and queryparam?
What is difference between Server.Transfer and Response.Redirect in ASP.NET?
Explain the features that make asp.net more used framework? : asp.net mvc
Explain the differences between clr & cts?
Describe the master page.
What are app services?
What is a ashx file?
How many types of state management are there in asp net?
Explain why datareader is useful?