【发布时间】:2010-07-19 10:12:55
【问题描述】:
如何将 xml (http://www.webservicex.net/country.asmx/GetCountries) 绑定到下拉列表?目前我正在使用 ASP.NET 2.0。
您好……
【问题讨论】:
标签: asp.net xml web-services drop-down-menu
如何将 xml (http://www.webservicex.net/country.asmx/GetCountries) 绑定到下拉列表?目前我正在使用 ASP.NET 2.0。
您好……
【问题讨论】:
标签: asp.net xml web-services drop-down-menu
谢谢 Marko,最后:
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
【讨论】:
首先,从后面的代码调用您的网络服务... 然后将您从 Web 服务获得的 xml 绑定到下拉列表。 在此链接上,您有如何做到这一点:
http://forums.asp.net/t/999571.aspx
干杯
【讨论】: