xml データを使用して、リピーター内にリピーターを配置しようとしています。希望どおりに動作していますが、使用した方法では各リピーターのデータがリロードされます。XmlNode としてキャストする必要があると思いますが、正直に言うと、どこから始めればよいかわかりません。
これが私のコードです。可能であれば、すべてをコード ビハインドに残しておきたいと思います。
<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>
何か案は?