This is a migrated thread and some comments may be shown as answers.

how to use datasource from webservice

3 Answers 105 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 22 Jul 2013, 11:01 AM
Hello

I can't attach webservice as a source of data to RadSearchBox

I have webservice:

[System.Web.Services.WebMethod(Description = "dane dla searchbox")]
 public List<MySearchBoxItemData> GetResults(string context)
 {
     DataTable data = GetData(context);
 
     List<MySearchBoxItemData> result = new List<MySearchBoxItemData>();
 
     for (int i = 0; i < data.Rows.Count; i++)
     {
         MySearchBoxItemData itemData = new MySearchBoxItemData();
         itemData.Text = data.Rows[i]["nazwisko"].ToString();
         itemData.Value = data.Rows[i]["nrewid"].ToString();
 
         result.Add(itemData);
     }
 
     return result;
      
 }
on my server:
http://ip.address/uslugi/apin01.asmx
How I must fill WebserviceSettings ?

<telerik:RadSearchBox ID="RadSearchBox2" runat="server" Height="16px" Width="244px" Filter="StartsWith">
      <WebServiceSettings Path="http://ip.address/uslugi/apin01.asmx" Method="GetResults" />
  </telerik:RadSearchBox>

Can I please for simple example with bindind to webservice data ?

regards,
Dominik

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 22 Jul 2013, 12:25 PM
Hi Dominik,

Please have a look at this documentation on RadSearchBox Binding to Web Service.

Thanks,
Princy.
0
Dominik
Top achievements
Rank 1
answered on 23 Jul 2013, 07:24 AM
Yes, I looked into Help about bound to webservice, but unfortunately I'm confused after reading.
Because help said about <WebServiceSettings Path="WebService.aspx" Method="GetResults" />
and I have Webservice.asmx on different server.
Why help said about webservice.aspx file ?

I move post to support.
0
Bozhidar
Telerik team
answered on 23 Jul 2013, 10:30 AM
Hello Dominik,

Thank you for pointing out this inconsistency. We will update the documentation. In the meantime, you can use the attached sample page as a reference as to how to bind to a web service.

Regards,
Bozhidar
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
SearchBox
Asked by
Dominik
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Dominik
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or