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
Is post back in asp.net?
How to disable validator control by client side JavaScript?
In the Repeater control which way you can edit?
Is it possible to apply themes to an asp.net application? If yes, then how?
How is it possible for .NET to support many languages?
Explain asp.net web forms.
Why web api is better than wcf?
What are the differences between clr & cts?
What are server objects?
In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?
What is application variable?
if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.
What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?
In which event of the page life cycle, is the viewstate available?
What is a url string?