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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek