ASP.NET
  Home arrow ASP.NET arrow Page 3 - Using ASP.NET AJAX
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 
Mobile Linux 
App Generation ROI 
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

Using ASP.NET AJAX
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 8
    2008-06-12

    Table of Contents:
  • Using ASP.NET AJAX
  • DOM Element Methods
  • Extensions to Existing JavaScript Objects
  • ASP.NET AJAX OOP Features for JavaScript

  • 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


    Using ASP.NET AJAX - Extensions to Existing JavaScript Objects


    (Page 3 of 4 )

    Chapter 2 described how to add methods to JavaScript base objects like Date. This feature has also been used heavily by the ASP.NET AJAX developers. As a result, JavaScript base types in the following list have been enriched with additional features:

    1. Array
    2. Boolean
    3. Date
    4. Error
    5. Number
    6. Object
    7. String

    None of these extensions alone is worth writing home about, but taken together, they can provide some real value if you write a lot of JavaScript code. Remember that a key idea of any Ajax framework is to dramatically reduce the amount of custom JavaScript code that needs to be written on top of the framework.

    Instead of a complete list, we’ll present just one easily written example. The newArray.forEach()method applies a function to each element of a given array.

      function Array$forEach(a, fnct){
        for (var i = 0; i = a.length; i++) {
            if (typeof(a[i]) != "undefined") {
              fnct.call(null, a[i], i, a);
          }
        }
      }

    However, the built-in ASP.NET AJAXforEach() method saves some typing, a bit of debugging, and a lot of extra maintenance work.

    An excellent overview of the new JavaScript object properties are available at no cost as PDF and XPS files. See the “For Further Reading” section at the end of this chapter for details on how to get those files.

    More ASP.NET Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming ASP.NET AJAX," published by...
     

    Buy this book now. This article is excerpted from chapter four of Programming ASP.NET AJAX, written by Christian Wenz (O'Reilly, 2007; ISBN: 0596514247). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - 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...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT