Reputation: 18610
I have an ASP.NET Web Forms Website that is running .NET 4.0. I have a simple search page that I want to pass filter criteria to a web service that will return JSON to the page. I will ideally be executing a GET request from jQuery to the web service.
Using ASP.NET MVC, it is pretty straight forward to create a controller action that returns JSON, however, I have no idea no how to do this in a ASP.NET Web Forms Website. How do I do create a web service in ASP.NET Web forms that returns JSON that I can simply call via AJAX?
Just give me the JSON!
Thanks,
Upvotes: 0
Views: 86
Reputation: 20620
It's easy, watch this video (it should be enough to get you started):
http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-and-call-a-simple-web-service-in-aspnet
And read this:
http://scriptionary.com/2011/03/25/returning-json-from-an-asp-net-web-service/
Upvotes: 1