Making Ajax calls to a controller action
Ajax calls can also be made to a Controller
action in ASP.NET MVC applications. In this example, let's post a request to the controller action from a View. 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 function |
This posts an Ajax request to the server with the set options. |
|
jQuery event |
This is fired when the value of an element changes. It corresponds to the JavaScript |
|
jQuery event binder |
This attaches an event handler for one or more events to the matched elements. |
|
jQuery method |
This returns the combined text content of each of the matched elements or sets the text content of every matched element. |
|
JavaScript function |
This removes whitespaces from the beginning and end of a string. |
|
jQuery method |
This returns the value... |