how to use datasource from webservice

4 posts, 0 answers
  1. Dominik
    Dominik avatar
    11 posts
    Member since:
    Oct 2011

    Posted 22 Jul 2013 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jul 2013 Link to this post

    Hi Dominik,

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

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dominik
    Dominik avatar
    11 posts
    Member since:
    Oct 2011

    Posted 23 Jul 2013 Link to this post

    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.
  5. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 23 Jul 2013 Link to this post

    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.
Back to Top