XML DataBinding to the Repeater Control;

G

Guest

hi

I have a xml file and I want to bind it to a nested repeaters. but the problem I'm having is now I cannot give reference to xml nodes inside the repeater.. pls advice me ..
the problem is in line 17. It's not able to render the CountrName from the tblCoutry xml node..
any idea's..?????

HTML with line numbers
---------------------------------
01) <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="hdb_vb.WebForm1"%>
02) <%@ Import Namespace="System.Xml" %>
03) <HTML>
04) <body>
05) <form runat="server" ID="Form1">
06) <h2>Hierarchical databinding test with XmlNode</h2>
07) <asp:Repeater id="_rep1" runat="server">
08) <itemTemplate>
09) AAA:<%# (Ctype(Container.DataItem, System.Xml.XmlNode)).Attributes("WorldRegionName").Value %><br>
10) <asp:Repeater runat="server" DataSource='<%# Container.DataItem %>' ID="Repeater1">
11) <itemTemplate>
12) &nbsp;&nbsp;Author:
13) <%# (Ctype(Container.DataItem, System.Xml.XmlNode)).Attributes("CountryName").Value %>
14) <br />
15) <asp:Repeater runat="server" DataSource='<%# Container.DataItem %>' ID="Repeater2">
16) <itemTemplate>
17) &nbsp;&nbsp;&nbsp;&nbsp;<i><a href='<%# (Ctype(Container.DataItem, System.Xml.XmlNode)).Attributes("CountryName").Value %>'><%# (Ctype(Container.DataItem, System.Xml.XmlNode)).Attributes("CountryMajorCityName").Value %></a></i><br />
18) </itemTemplate>
19) </asp:Repeater>
20) </itemTemplate>
21) </asp:Repeater>
22) <hr />
23) </itemTemplate>
24) </asp:Repeater>
25) </form>
26) </body>
27)</HTML>
FINISH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top