XML DataBinding to the Repeater Control;

Discussion in 'ASP .Net' started by =?Utf-8?B?THVkbWFs?=, Apr 5, 2004.

  1. 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
     
    =?Utf-8?B?THVkbWFs?=, Apr 5, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    861
  2. hazz
    Replies:
    0
    Views:
    523
  3. Charlie@CBFC
    Replies:
    3
    Views:
    1,679
    Charlie@CBFC
    Sep 16, 2006
  4. jobs
    Replies:
    0
    Views:
    1,631
  5. Earl Teigrob
    Replies:
    1
    Views:
    406
    Shravan
    Mar 1, 2004
Loading...

Share This Page