|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Bind DropDownList to XmlDataSourcesure is
http://www.eggheadcafe.com/articles/20011128.asp -- Show quoteHide quoteRegards John Timney ASP.NET MVP Microsoft Regional Director "Thor W Hammer" <thorwham***@hotmail.com> wrote in message news:438716ed$1@news.broadpark.no... > Is it possible?? > > Hi Thor,
the following ASPX shows it is possible. You do have to bind to an attribute though. I wasn't able to bind to a inner child. Grtz, Wouter van Vugt Trainer - Info Support - www.infosupport.com www.dive-in-it.nl <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected override void OnLoad(EventArgs e) { DropDownList1.DataBind(); base.OnLoad(e); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="XmlDataSource1" DataTextField="ID"> </asp:DropDownList> <asp:XmlDataSource ID="XmlDataSource1" runat="server"> <Data> <Customers> <Customer id="Customer1"> <ID>Customer1</ID> <Name>First Customer</Name> </Customer> <Customer id="Customer2"> <ID>Customer2</ID> <Name>Second Customer</Name> </Customer> <Customer id="Customer3"> <ID>Customer3</ID> <Name>Third Customer</Name> </Customer> <Customer id="Customer4"> <ID>Customer4</ID> <Name>Fourth Customer</Name> </Customer> </Customers></Data> </asp:XmlDataSource> </div> </form> </body> </html>
Other interesting topics
Consuming less memory when writing a file?
run asp.net without a web server Visual Web Developer Express How do I build Code-behind into DLL in bin folder Web Projects in VS 2005 How to change LabelText in DataList A translatable website Cannot display Chinese data from database Mouseover, mouseout, click etc on datagrid. Application and Session state stored in SQL Server Data Access Layer |
|||||||||||||||||||||||