O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

$("#identifier")

jQuery selector

This selects an element based on its ID.

$.ajax()

jQuery function

This posts an Ajax request to the server with the set options.

change

jQuery event

This is fired when the value of an element changes. It corresponds to the JavaScript change event.

.on()

jQuery event binder

This attaches an event handler for one or more events to the matched elements.

.text()

jQuery method

This returns the combined ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required