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. Advertisements

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. Ed Allan

    Nested repeater databinding question

    Ed Allan, Aug 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,103
    Ed Allan
    Aug 1, 2003
  2. Replies:
    0
    Views:
    1,085
  3. =?Utf-8?B?bXVzb3NkZXY=?=

    Repeater DataBinding - moving the Data forward

    =?Utf-8?B?bXVzb3NkZXY=?=, Apr 1, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    944
    =?Utf-8?B?bXVzb3NkZXY=?=
    Apr 2, 2006
  4. hazz
    Replies:
    0
    Views:
    627
  5. Charlie@CBFC
    Replies:
    3
    Views:
    1,995
    Charlie@CBFC
    Sep 16, 2006
  6. Milsnips
    Replies:
    1
    Views:
    473
    Milsnips
    Oct 3, 2006
  7. jobs
    Replies:
    0
    Views:
    2,332
  8. Earl Teigrob
    Replies:
    1
    Views:
    648
    Shravan
    Mar 1, 2004
Loading...