I know MVC controllers are quite good at serving JSON formatted AJAX requests, but is there any built-in ASP.NET functionality I can use for these type calls from a plain old web forms site?
I know MVC controllers are quite good at serving JSON formatted AJAX requests, but
Share
You could use built-in ASP.NET AJAX.
Option 1 – use a web service (if you want the functionality to be reusable):
Option 2 – use page methods (if you want the functionality on a single page without creating a web service):
In either case JSON will be used for data transfer.
Here is an extensive tutorial with some code samples.
However, ASP.NET AJAX is often blamed for inefficiency – for instance, JS it generates tends to be rather large. So, if you are concerned with performance, you’d want to test it thoroughly.
You might also have a look at this thread: .NET AJAX Calls to ASMX or ASPX or ASHX?