ASP.NET
  Home arrow ASP.NET arrow Ajax: Creating Native JavaScript Objects F...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Ajax: Creating Native JavaScript Objects From SQL
By: James Robson
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 4
    2007-05-29

    Table of Contents:
  • Ajax: Creating Native JavaScript Objects From SQL
  • Setting up the .NET project
  • The .NET server page
  • The Ajax client page

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!

    Ajax: Creating Native JavaScript Objects From SQL


    (Page 1 of 4 )

    Ajax is useful for fetching data to web pages without requiring that the pages reload; it speeds up the user experience of your web site. This article will show you how to build an ASP.NET web application in C# that takes advantage of Ajax's dynamic ability.
    A downloadable zip file is available for this article.

    Overview

    Ajax stands for Asynchronous JavaScript and XML. It's an important technology because it allows you to fetch data after a web page has already been loaded, and modify the page according to the dynamic data it receives "behind the scenes." As the name implies, Ajax was initially intended for fetching XML. Once the XML data is received, the JavaScript code in the web page has to parse it and do something with it that your browser can understand. Usually, this means converting it into HTML, or modifying existing HTML form field values. But Ajax is not restricted to getting XML data from the servers.

    JSON stands for JavaScript Object Notation. It's a lightweight data-interchange format that the JavaScript language can understand natively, as an object. So, unlike XML, which has to be parsed, the JSON data can be converted directly into a real JavaScript object with a single call to the eval() function. You can then access the data the way you would any other JavaScript object, through member references. Data returned in JSON format is also generally smaller than the equivalent XML representation, which can save bandwidth. It is also "easy for humans to read and write.... [and] ... easy for machines to parse and generate."

    In this tutorial I will build a simple ASP.NET web application in C# that will provide a dynamic page (response.aspx) that can be passed SQL statements directly. The page will query against the Northwind database in Microsoft SQL Server, and return the data as a simple JSON object. An HTML document (ajaxtest.html) acts as the "client" to response.aspx, and demonstrates Ajax methods using JSON data.

    More ASP.NET Articles
    More By James Robson


     

    ASP.NET ARTICLES

    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...
    - Order-Related Modules for an ASP.NET AJAX Se...
    - User and Role Management for an ASP.NET AJAX...
    - Programming an ASP.NET AJAX Server-Centric B...

    Click Here




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway