ASP.NET
  Home arrow ASP.NET arrow Page 3 - Enhancing PHP Via the ASP.NET AJAX Framewo...
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

Enhancing PHP Via the ASP.NET AJAX Framework: A Second Look
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 3
    2008-06-30

    Table of Contents:
  • Enhancing PHP Via the ASP.NET AJAX Framework: A Second Look
  • Code Examination
  • Post Code Examination
  • Watch the result of asynchronously invoking the PHP web service

  • 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


    Enhancing PHP Via the ASP.NET AJAX Framework: A Second Look - Post Code Examination


    (Page 3 of 4 )

    Due to the above examination, we cannot utilize the client-side offline DataSource component (in the xml-script declarative mode) and invoke the web service in the JavaScript mode.

    A placeholder and the related templates for ASP.NET AJAX client-side control ListView are defined within the first part of the <body> text. As for how the templates correspond to the xml-script code snippet below, you can refer to the associated online ASP.NET AJAX tutorials at http://asp.net/ajax/. Here, we continue to leave space for web service invocation discussion.

    When you click 'Get Animals,' the associated click event handler GetAnimals() is triggered. Then the control stays inside the JavaScript and the web service method is invoked. The code is listed below:

    function GetAnimals()

    {

    AnimalService.GetAllAnimals(OnCompleted);

    }

    function OnCompleted(items)

    {

    $find("Results").set_data(items);

    }

    It all seems to call a local method, doesn't it? This is due to the automatically-generated client-side web service proxy discussed above. We first find the ListView instance 'Results' (not the 'div' DOM element!), and by calling the method set_data() of the ListView control, we successfully assign data to the control. All this occurs within the callback function OnCompleted() via the ASP.NET AJAX client-side global method 'findComponent' ('$find' for short).

    By the way, we can use the debug techniques introduced in the Microsoft AJAX Library to track down the interesting data posted from the server side. To do this, we just, as usual, put a <textarea> element with the ID attribute 'TraceConsole' in the proper location of the page and then use methods of the Sys.Debug class to debug the related data. Figure 5 corresponds to the tracking snapshot the uses the Sys.Debug.traceDump() method.

    Figure 5-use Microsoft AJAX Library's debug support to debug the sample


    Last but not least, in the above xml-script declarative programming, readers should have been aware that by introducing PreviewScript.debug.js, not only can we utilize the xml-script mode to facilitate the client-side programming, but also to use many new concepts, such as transformer components, validate components, actions, behaviors, etc. so as to strengthen and extend the client ability.

    Now, it's time to take a look at the running-time snapshot of our sample.

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - Developing a Mini ASP.NET AJAX Server Centri...
    - Disadvantages of the ASP.NET MVC Framework
    - 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

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




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