Accessing Server-Side Data from Client Script: Exposing Server-side Data with ASP.NET Ajax | CodeGuru

Accessing Server-Side Data from Client Script: Exposing Server-side Data with ASP.NET Ajax

Today’s websites commonly exchange information between the browser and the web server using Ajax techniques. In a nutshell, the browser executes JavaScript code typically in response to the page loading or some user action. This JavaScript makes an asynchronous HTTP request to the server. The server processes this request and, perhaps, returns data that the […]

Written By
CodeGuru Staff
CodeGuru Staff
Oct 27, 2010
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Today’s websites commonly exchange information between the browser and the web server using Ajax techniques. In a nutshell, the
browser executes JavaScript code typically in response to the page loading or some user action. This JavaScript makes an asynchronous
HTTP request to the server. The server processes this request and, perhaps, returns data that the browser can then seamlessly
integrate into the web page. Typically, the information exchanged between the browser and server is serialized into JSON, an open, text-based serialization format that is both
human-readable and platform independent.

Adding such targeted, lightweight Ajax capabilities to your ASP.NET website requires two steps: first, you must create some
mechanism on the server that accepts requests from client-side script and returns a JSON payload in response; second, you need to
write JavaScript in your ASP.NET page to make an HTTP request to this service you created and to work with the returned results. This
article series examines a variety of techniques for implementing such scenarios. In Part 1, Accessing Server-Side Data from Client Script, we
used an ASP.NET page and the JavaScriptSerializer class to create a
server-side service. This service was called from the browser using the free, open-source jQuery JavaScript library.

This article continues our examination of techniques for implementing lightweight Ajax scenarios in an ASP.NET website.
Specifically, it examines how to create ASP.NET Ajax Web Services on the server-side and how to use both the ASP.NET Ajax Library and
jQuery to consume them from the client-side. Read the entire article, Accessing Server-Side Data from Client Script: Exposing Server-side Data with ASP.NET Ajax

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.