The JQuery has following methods that can be used to perform Ajax requests:
- ajax() - Load a remote page using an HTTP request. This is jQuery's low-level AJAX implementation.
- load() - Load HTML from a remote file and inject it into the DOM.
- get() - Load a remote page using an HTTP GET request.
- getJSON() - Load JSON data using an HTTP GET request.
- post() - Loads HTML by performing an HTTP post request.
In this article, I will show you how to build a Jquery AJAX enabled ASP.NET MVC application. To create a new MVC project, see ASP.net MVC application structure. I will consume a USA Weather Forecast web service which is freely available at WebserviceX.NET
Using the code
To reference the Jquery AJAX script libraries, add the following markup at the end of the head element in Site.Master: