<Lookup>
<Lookup_Entry >
<Ts>
<T>
<M>context</M>
<V>type</V>
<Va>Citizen</Va>
</T>
</Ts>
<U>.html</U>
</Lookup_Entry>
</Lookup>
example of xml file is above
code:
<asp:XmlDataSou rce ID="XmlDataSour ce1" runat="server" DataFile="~/Lookup
table.xml"
XPath='/Lookup/Lookup_Entry/Ts/T/Va[../../T[M = "context" and V
= "type"]]'>
</asp:XmlDataSour ce>
<asp:CheckBoxLi st
ID="CheckBoxLis t1"
runat="server"
DataSourceID="X mlDataSource1">
</asp:CheckBoxLis t>
Now how do i get each <Va> that is returned with the xmldatasource as a item
in my checkboxlist
displayed now when run is with a checkbox to the left of each item:
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
System.Web.UI.W ebControls.XmlD ataSourceNodeDe scriptor
mike
"Andrea Zani" wrote:
mike <mi**@discussio ns.microsoft.co m> ha scritto: can somebody please show me some code that will let me populate a
checkboxlist from the xmldatasource, and have the text property set
to the names in the xml file
thanks
With this XML file:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<item value="1" text="Value 1" />
<item value="2" text="Value 2" />
<item value="3" text="Value 3" />
</root>
And this code:
<asp:CheckBoxLi st ID="CheckBoxLis t1" runat="server"
DataSourceID="X mlDataSource1"
DataTextField=" text" DataValueField= "value">
</asp:CheckBoxLis t><asp:XmlDataS ource ID="XmlDataSour ce1" runat="server"
DataFile="~/Data/XMLFile.xml"></asp:XmlDataSour ce>
--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az