Client-side Templates with WCF binding

7 posts, 1 answers
  1. Tarek
    Tarek avatar
    23 posts
    Member since:
    Mar 2013

    Posted 05 Nov 2013 Link to this post

    Dear Telerik,
    I know that Client-side Templates are applicable with ODataSource bind. What is the case with WCF binding ?

    Thanks in advance
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 07 Nov 2013 Link to this post

    Hello,

     
    Yes, client templates are working properly with WCF and WebService binding too as for example it is shown in this help article.

    Regards,
    Plamen
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tarek
    Tarek avatar
    23 posts
    Member since:
    Mar 2013

    Posted 07 Nov 2013 Link to this post

    Ok, it's working with Page Method and returning this json result :
    {"d":[{"__type":"Telerik.Web.UI.SearchBoxItemData","Text":"","Value":"","DataItem":{"TYPE":"Account","CODE":"41|CRM_ACCOUNT|F","NAMEALPHA":"EASoft","EMAIL1":"mail@web.com","PHONE1":"1234"}}]}

    but with WCF it's showing nothing because it's returning this format of json :
    {"GetSearchListResult":[{"_dataItem":[{"Key":"TYPE","Value":"Account"},{"Key":"CODE","Value":"41|CRM_ACCOUNT|F"},{"Key":"NAMEALPHA","Value":"EASoft"},{"Key":"EMAIL1","Value":"mail@web.com"},{"Key":"PHONE1","Value":"1234"}],"_text":"","_value":""}]}

    My WCF method is :
    [OperationContract]
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped,
    ResponseFormat = WebMessageFormat.Json)]
    SearchBoxItemData[] GetSearchList(SearchBoxContext context);

    the same method is used in Page Method but without these headers :
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped,
    ResponseFormat = WebMessageFormat.Json)]

    so I think here is the issue in formatting the Response


  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 12 Nov 2013 Link to this post

    Hi,

     
    I am attaching a sample web page where is implemented how we recommend you achieve such scenario with RadSearchBox that is bound to WCF.

    Hope this will be helpful.

    Regards,
    Plamen
    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.
  6. Tarek
    Tarek avatar
    23 posts
    Member since:
    Mar 2013

    Posted 14 Nov 2013 Link to this post

    Dear Plamen, this sample project is not working . It's returning a result in the attachment below
  7. Answer
    Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 18 Nov 2013 Link to this post

    Hi,

     
    It looks that there is something different in the way the project is tested or in the environment because it worked correctly at my side. Here is a video of my test. Please review it and let me know what else should I do or add to observe the unusual issue described and be able to inspect it and be more helpful in solving it.

    Regards,
    Plamen
    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.
  8. Tarek
    Tarek avatar
    23 posts
    Member since:
    Mar 2013

    Posted 23 Nov 2013 Link to this post

    Dear Plamen, you are right this issue was caused in version 2013 Q1, after upgrading to Q3 the demo worked well .
    Thank you
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017