Programming, Web News, Web Hostings, Technology
Consuming ASP.NET Handler By jQuery Ajax With JSON
Step towards Web 2.0 development nowdays, ajax is one of the important element in web development. There are various way of doing asynchronous call to server or web service to execute a job.
In this post, I am using jQuery to consume ASP.NET handler through a simple javascript codes. In the normal scenario, if client side requesting a simple string, server just have to return response context with plain/text. If you wish to return a set of data to be return in formatted string, you can either have the options like text/xml or application/json. My example code here will be using application/json with the assistance of third party component, Newtonsoft Json.
Scenario
“I Wish to use javascript to execute a job asynchronously to ASP.NET and receiving set of data in object. I do not wish to make my asynchronous call to any of my ASP.NET aspx pages because it is not a best practice. How can I do it?”
Expectation
- Data return from server in JSON object
- Calling ASP.NET handler
- Using jQuery
Prerequisite Component
- jQuery 1.3.2
- Newtonsoft Json
Solution File Structure

Download hellojson_050509_1229
Related posts:
- Microsoft Application Architecture Guide 2nd Edition from Patterns & Practices Microsoft Patterns & Practices released the 2nd edition of their...
- ASP.NET MVC – How to implement querystring In this tutorial, I would like to share with you...
- Tips: ASP.NET Webform Postback Twice If your ASP.NET webform is postback twice, then you are...
| Print article | This entry was posted by ervinter on May 5, 2009 at 12:32 pm, and is filed under Programming. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |