G
Guest
Hi ,
I'm working with Whidbey...
I am trying to bind an XML to a DropDownList control. I wrote
something of this sort…
<asp:XmlDataSource ID="loader1" Runat="server" DataFile="island.xml"
XPath="Customers/customer/Customer">
</asp:XmlDataSource>
<asp
ropDownList ID="DropDownList1" Runat="server"
DataSourceID="loader1" DataTextField= "country" >
</asp
ropDownList>
This gives an error : DataBinding:
'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a
property with the name 'country'.
However the following works fine,
<asp:Repeater ID="Repeater1"
DataSourceID="loader1"
runat="server">
<ItemTemplate>
<h1><%# XPath ("country") %></h1>
</ItemTemplate>
</asp:Repeater>
So, I tried giving a similar XPath in DataTextField , but doesn’t recognize
it.
Any pointers...
Kicha
I'm working with Whidbey...
I am trying to bind an XML to a DropDownList control. I wrote
something of this sort…
<asp:XmlDataSource ID="loader1" Runat="server" DataFile="island.xml"
XPath="Customers/customer/Customer">
</asp:XmlDataSource>
<asp
DataSourceID="loader1" DataTextField= "country" >
</asp
This gives an error : DataBinding:
'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a
property with the name 'country'.
However the following works fine,
<asp:Repeater ID="Repeater1"
DataSourceID="loader1"
runat="server">
<ItemTemplate>
<h1><%# XPath ("country") %></h1>
</ItemTemplate>
</asp:Repeater>
So, I tried giving a similar XPath in DataTextField , but doesn’t recognize
it.
Any pointers...
Kicha