Advertise with us
Control Panel
Forum
Hosting Help
ASP.NET 4.5 & SQL 2012 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
Home
»
Resources
»
Fill DropDown List with XML File
ASP.NET
ADO.NET
Web Services
Remoting
Visual Studio 2005
Error Bank
Interview Questions
Tips & Tricks
XML
HTML
Jscript/Javascript
IIS
Windows
General
Submit Resource or code snippet
... and get
surprise gifts
Win Digital camera, ASP.NET Books, Free softwares!!
Fill DropDown List with XML File
20 Sep, 2010
Author:
hazem
rrr
Summary
This is an easy way to fill DropDownList with XML file
.NET Classes used :
system.data
The XMLFile.xml
<citys>
<city>
<cid>
1
</cid>
<cityname>
us
</cityname>
</city>
<city>
<cid>
2
</cid>
<cityname>
egypt
</cityname>
</city>
</citys>
***********************
At Page_laod
Dim xfile As String = Server.MapPath(~/XMLFile.xml)
Dim ds As New DataSet
If Page.IsPostBack = False Then
ds.ReadXml(xfile)
DropDownList1.DataSource = ds
DropDownList1.DataTextField = cityname
DropDownList1.DataValueField = cid
DropDownList1.DataBind()
End If
Feedbacks about this page from members:
- No Feedbacks yet !! -
Submit Feedback
View All Feedbacks
Total
members
:
250603
Average new registrations per day (in last 7 days):
11
New Registration:
Open
Register Now
Talk to Webmaster
Tony John
Facebook
Google+
Twitter
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.