Consuming page methods
Page methods provide a convenient way of invoking server-side code from the client script. They are simply server-side methods that are decorated with the System.Web.Services.WebMethod
label. In this recipe, we will use the Northwind database in a page method to retrieve a list of customers from a particular country. The method will be invoked from the client script using jQuery Ajax.
The constructs used in this example are summarized in the following table:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element based on its ID. |
|
jQuery selector |
This selects all elements with the specified HTML tag. |
|
jQuery function |
This posts an Ajax request to the server with the set options. |
|
jQuery method |
This inserts content at the end of each matched element. |
|
jQuery event |
This is fired when you click on an element. It corresponds to the JavaScript |
|