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 r the asp.net list controls and difference between them?
What are the types of session in asp.net?
What is the used of "ispostback" property?
Explain the life cycle of an ASP .NET page
2 Answers HCL, Surya Software,
Why does a user need nothing more than a Web browser to view ASP.NET pages?
What is advantage of asp.net?
What is the state management in asp.net?
When we are requesting a new URL through Response.Redirect() the new page wil open on the new browser window or it wil open in the same window? If we use Server.Transfer() what wil happen?
Explain the use of errorprovider control in .net?
What is web.config. How many web.config files can be allowed to use in an application ?
10 Answers Accenture, BirlaSoft, Infosys, InterGraph, Satyam, Wipro,
What is view state and use of it ?
What are ASP.NET Web Forms? How is this technology different than what is available though ASP?