I need to bind purticular external webservice webmethods name with in asp:dropdownlist at run time. anybody can help please..

Thanks in advance..

Suganya.B

Recommended Answers

All 2 Replies

>Bind Webmethod names with in asp.net control

First, you can call webservice on client (JavaScript) to retrieve the data.

It depends on what format you are receiving the data from the WebService but the syntax is as follows:

Dim reader As New System.IO.StringReader(<Webservice>) 

DataSet dataset = new DataSet(); 
dataset.ReadXml(reader); 

myDropDownList.DataSource = dataset.Tables[0]; 
myDropDownList.DataValueField = "value_field"         
myDropDownList.DataTextField = "text_field"
myDropDownList.DataBind();

The reader object is used to access the Webservice feed which and is expecting an XML string (for this example)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.