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 HTTP handler

A HTTP handler is a process that is executed when a request is made for a particular resource. For example, ASP.NET provides a page handler to process *.aspx files. Another example of an inbuilt handler is the web service handler used to process *.asmx files.

In this recipe, let's write a generic HTTP handler that will return custom data to the calling script. 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

$.map()

jQuery function

This transforms an array or object into another array ...

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