views:

135

answers:

1

I have just experimented my first ajax enabled WCF service in a sample asp.net webform application... If i have 10-15 pages in my webapplication which involves add,edit,view and delete operations, is it possible to make them ajax post and get without using .cs(codebehind) of all pages...

What are the pros and cons when choosing ajax enabled WCF service in an asp.net webform application?

+1  A: 

At first, if you want to implement the server side of jQuery Ajax calls, you can do this with either ASMX or WCF services. You can find a short comparison between these two here. WCF is more modern technology and will be my preferred choice for new projects. It can provide you with the following:

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

As an disadvantage I would say that it will take you some time to learn the technology. I found that proper configuration of web.config was a little tricky.

I usually have a single svc service that serves all Ajax requests. You can implement as many methods as you want in a single service. The services are called from different pages.

kgiannakakis
@Kgiannakakis well said.. I implemented a page with complete HTML Controls including add edit delete functionalities... It is quite interesting.... But i want to know about cons when hosting this application to a server...
Pandiya Chendur