How can you provide an alternating color scheme in a
Repeater control?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / aadesh kumar
AlternatingItemTemplate Like the ItemTemplate element, but rendered for every other row (alternating items) in the Repeater control. You can specify a different appearance for the AlternatingItemTemplate element by setting its style properties.
Is This Answer Correct ? | 0 Yes | 0 No |
What is boxing and unboxing in asp.net?
What is CSS? What is the advantage os using CSS in ASP.NET Web Applications?
What does AspCompat="true" mean and when should I use it?
where the stored procedure are written in business logic or data acess layer?
Which data types are supported by the RangeValidator control?
Is asp.net and .net same?
To make Cache item dependent on a file,directory or other cached item ,you should create an instance of which clause?
can we pass values from one page to another page without redirecting to that page?
6 Answers Google, Patni, Syntel, Wipro,
what r the Templeats in ASP.net?
What are the difference between ASP and ASP.Net?
What is the use Membership in asp.net? and What is the use profiler in asp.net?
How can we Validate a Controls in ASP.NET page using JavaScript?