Is it possible to use WCF service instead of .asmx web service with AJAX Control Toolkit Slideshow extender?

别等时光非礼了梦想. 提交于 2019-12-24 14:52:51

问题


I have a working WCF service that I can call via AJAX javascript routine. I cannot get it to work with the Slideshow extender in the Ajax Control Toolkit. No errors reported, slideshow just does not load and run. I can write AJAX javascript routine within the page and successfully access the return results from the WCF service (array of images). I can use the Slideshow extender without problem using an .asmx web service, but would prefer to use a WCF service if possible.


回答1:


I'm not sure about the concrete example here (Ajax Control Toolkit Slideshow extender), but in general, yes, you can access WCF services from Ajax - see here:

  • Access an AJAX enabled WCF Service
  • JSON-enabled WCF Services in ASP.NET
  • Ajax Autocomplete Extender with WCF

Hope this helps a a bit!

Marc




回答2:


I think this is a bug in the SlideShowExtender.

I have gotten it to work with a PageMethod and an asmx web service but cannot get to work with wcf service.

If I create a AJAX enable WCF service, register it with ScriptManager and call it myself via the auto-generated proxy, I successfully get back the JSON data with the array of slides that I returned from the WCF service.




回答3:


As Marc mentioned, you can use a WCF service with Ajax. The links he cites are good, but there is also an "Ajax Enabled WCF Service" option available when you add a new item in VS 2008 or 2010.

You can also use Dependency-Injection with Spring.Net on a WCF Service that responds to Microsoft Ajax calls. The directions to do so are located on my blog here: http://emilsblog.lerch.org/2010/02/springnet-enabled-wcf-services.html



来源:https://stackoverflow.com/questions/1401950/is-it-possible-to-use-wcf-service-instead-of-asmx-web-service-with-ajax-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!