What are the pros and cons of choosing an ajax-enabled WCF service in an asp.net web application?

I just experimented with the first ajax enabled WCF service in an asp.net webform application example ... If I have 10-15 pages in my web application that includes add,edit,view and delete operations, is it possible to make them ajax post and get without using .cs(codebehind) all pages ...

What are the pros and cons of choosing an ajax-enabled WCF service in an asp.net web application?

+3
source share
1 answer

First, if you want to implement the server side of jQuery Ajax calls, you can do this using ASMX or WCF services. You can find a brief comparison of the two here . WCF is a more advanced technology and will be my preferred choice for new projects. He can provide you with the following:

  • Help you program the interface.
  • It will serialize / deserialize the objects for JSON for you. No need for JSON libraries.
  • Provides client methods that you can use (via ScriptManager). It is also easy to use jQuery if you prefer

As a flaw, I would say that it takes you some time to learn the technology. I found that setting up web.config correctly was a bit complicated.

Usually I have one svc service that serves all Ajax requests. You can implement as many methods as you want in one service. Services are called from different pages.

+1
source

Source: https://habr.com/ru/post/1300726/


All Articles