1

Possible Duplicate:
Where can I get a list of all countries/cities to populate a listbox?

I'm trying to fill my dropdownlist with all world countries from windows, is there any way to make my dropdownlist get all countries from windows?

Or do anybody have a XML with all the list so I can use it?

Community
  • 1
  • 1
HAJJAJ
  • 3,667
  • 14
  • 42
  • 70

1 Answers1

4

Update 8/9/2016:

List of Countries


Just did a quick search and found this site:

http://madskristensen.net.web7.reliabledomainspace.com/post/XML-country-list.aspx.

Here's the direct link to the file:

http://cid-247fb0008340dbcd.office.live.com/self.aspx/workstion/countries.xml

Update: Code to populate your drop down list with the list of countries:

Dim doc = XDocument.Load("path to url\file")

Dim countries = From c in doc.Descendants("country")
                Select c.Value

For Each country In countries
    DropDownList.Add(country)
Next

DropDownList.DataBind()
aligray
  • 2,812
  • 4
  • 26
  • 35