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 are the various session state management options provided by asp.net?
Is it possible to create web application with both webforms and mvc?
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?
Define the term Web Garden?
What is asp short for?
What is cookieless session id explain in brief?
What is dynamic web page with example?
What is use of Master Page in ASP.NET web pages?
Is asp.net mvc still used? : Asp.Net MVC
What is the function of the ViewState property?
Is it true that a Web service must be written in .NET or not?
Why is this service branded with windows livetm?
How would ASP and ASP.NET applications run at the same time on the same server?
What is the purpose of master page?
how to include timer or counting time to display next page in asp.net