如何將xml(http://www.webservicex.net/country.asmx/GetCountries)綁定到下拉列表?目前我正在使用ASP.NET 2.0。asp.net:將Web服務中的XML綁定到下拉列表中
問候......
如何將xml(http://www.webservicex.net/country.asmx/GetCountries)綁定到下拉列表?目前我正在使用ASP.NET 2.0。asp.net:將Web服務中的XML綁定到下拉列表中
問候......
THX馬爾科,最後:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myGeoService As New net.webservicex.www.country
Dim myISOcodes As String = myGeoService.GetCountries
Dim reader As New System.IO.StringReader(myISOcodes)
If Not Page.IsPostBack Then
Dim mycountries As New DataSet
mycountries.ReadXml(reader)
DropDownList1.DataSource = mycountries
'DropDownList1.DataValueField = "value"
DropDownList1.DataTextField = "Name"
DropDownList1.DataBind()
End If
End Sub
我很高興我幫助過...乾杯 – Marko 2010-07-19 22:12:30
我已經叫 昏暗myGeoService作爲新net.webservicex.www .country Dim myISOcodes As String = myGeoService.GetCountries 但myISOcodes只是字符串。接下來的問題是如何將字符串更改爲數據集? – user168507 2010-07-19 10:33:30
GetCountries返回什麼? – Marko 2010-07-19 11:33:02
在瀏覽器中打開 http://www.webservicex.net/country.asmx/GetCountries – user168507 2010-07-19 11:57:13