I am trying to place a repeater within a repeater using xml data. I have it working exactly as I want, but the method I have used reloads the data for each repeater. I think I need to cast as an XmlNode but I'll be honest - I have no idea where to start.
Here is my code - I'd like to keep everything in the code behind if possible.
<script runat="server">
Public doc As New XmlDocument()
Public Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
If Not Page.IsPostBack then
doc.Load(Server.MapPath("~/myxml/bookstore.xml"))
Dim nodes As XmlNodeList = doc.SelectNodes("Bookings/Booking[@CLIENT_NO='SA33762']")
rpMyRepeater.DataSource = nodes
rpMyRepeater.DataBind()
End If
End Sub
Protected Sub itemDB(ByVal s As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim rpt As Repeater = CType(e.Item.FindControl("books"), Repeater)
If Not (rpt Is Nothing) Then
doc.Load(Server.MapPath("~/myxml/bookstore.xml"))
Dim nodes2 As XmlNodeList = doc.SelectNodes("Bookings/Booking[@CLIENT_NO='SA33762']/Products/Book")
rpt.DataSource = nodes2
rpt.DataBind()
End If
End If
End Sub
</script>
Any ideas?