Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Other Languages
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Other Languages
XML binding to <asp:dropdownlist> declaratively
sasank manohar
Ranch Hand
Posts: 186
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have an xml file like
//StateXml.xml <?xml version="1.0" encoding="utf-8" ?> <States> <State> <ID>1</ID> <Name>State Name1</Name> </State> <State> <ID>2</ID> <Name>State Name2</Name> <State> <ID>3</ID> <Name>State Name3</Name> </State> <State> <ID>4</ID> <Name>State Name4</Name> </State> <State> <ID>5</ID> <Name>State Name5</Name> </State> </State> </States>
and an aspx file like
//StateDDL.aspx
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>State</title> </head> <body> <form id="form1" runat="server"> <asp:XmlDataSource runat="server" id="StateXmlDS" XPath="/States/State" DataFile="StateXml.xml" /> <asp:DropDownList runat="server" ID="DropDownListID" AppendDataBoundItems="true" DataSourceID="StateXmlDS" DataTextField="Name" DataValueField="ID"> <asp:ListItem Text="--select--" Value="1" /> </asp:DropDownList> </form>
both these files are in C:\Inetpub\wwwroot
so when i am compiling the aspx page , i am getting an error like this
DataBinding: 'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a property with the name 'Name'.
so what could be the problem?
Campbell Ritchie
Marshal
Posts: 79153
377
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sounds like a question which would get better attention in our XML forum> moving.
Campbell Ritchie
Marshal
Posts: 79153
377
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I earlier wrote:
Sounds like a question which would get better attention in our XML forum> moving.
. . . and somebody says it would have been better back in "other languages". Sorry
It will appear in two places now, and I shall move it back.
Did you miss me? Did you miss this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Need help with Jquery
Read data to the xml file from the database?
How to get to the custom tags on a page from a scriptlet?
project file structure for web application (war).
Opening a webpage in same window using javascript without anchor tag
More...