Repeater controls are great for displaying lists. But these the lists displayed are not valid XHTML. To make sure my pages are valid I have had to use a workaround.
For my events list I created a shared function, in case I need to reuse it.
Public Shared Function getOrderedEventsList (ByVal ds As DataSet) As String
'take dataset and return an ordered list string that is valid XHTML
Dim strResult As String = String.Empty
strResult += "<ol>"
Dim dr As DataRow
For Each dr In ds.Tables(0).Rows
strResult += "<li>" & dr("EventTitle") & "</li>"
Next
strResult += "</ol>"
Return strResult
End Function
Using an empty div and from the code behind I am filling it using InnerHtml.
divName.InnerHtml = getOrderedEventsList(dataset)
You can use this for any dynamic list instead of a repeater. And your code will be valid XHTML.
.Net
xhtml, .net