views:

67

answers:

1

Are there any VS template/Starter Kit/Any example of an ASP.NET Web Application, which uses jQuery and WCF (JSon), without ASP.NET Web Forms or ASP.NET Ajax, and generates clean code?

jQuery and C# for Web. No Web Forms/MVC. Is it actually possible?

A: 

Completely possible. You should start by using a webHttpBinding for your endpoint and naturally you need to apply the webHttp behavior as well. Then, when coding your WCF service, set the ReqeustFormat/ResponseFormat properties of the WebGet/InvokeAttributes which are applied to your operations.

From the jQuery perspective you can now call these methods using the jQuery.ajax() API or any of the simpler variations (i.e. .load(), .get(), .post(), etc.). Obviously the method you use has to correlated with what HTTP method you've configured the service to expect.

Drew Marsh