ASP.NET
  Home arrow ASP.NET arrow 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


    (Page 1 of 4 )

    Welcome to the second and final article in this tutorial about introducing the ASP.NET AJAX client-side framework into PHP programming. The first article covered how to set up the web service and this article will complete the discussion so we can fully utilize the AJAX feature within PHP via the Microsoft AJAX Library.

    Write an HTML page to invoke the PHP web service

    Now that the web service is ready to use, we can write a common web page (it can be a .php, .htm, or .html file-here we select the .html form) to invoke the web service. The sample .html file we built here is named index.html. And for convenience, we listed all the related source code below.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">


    <head>

    <title>ASP.NET AJAX On PHP Demo</title>

    <link href="site.css" rel="stylesheet" type="text/css" />


    <script type="text/javascript" src="MicrosoftAjax.js"></script>

    <script type="text/javascript" src="PreviewScript.debug.js"></script>

    <script type="text/javascript" src="AnimalService.php/js"></script>


    </head>

    <body>

    <div id="Contents">

    <div>

    <input type="button" onclick="GetAnimals()" value="Get Animals" />

    </div>


    <!-- Visual templates for ListView control-->


    <div id="Results">

    <div style="display:none;">

    <div id="Results_layout">

    <div id="Results_layout_parent">


    <div id="Result_item" class="resultItem">

    <span id="Result_Name" class="Result_Name"></span>

    <span id="Result_Category" class="Result_Category"> </span>

    <span id="Result_Color" class="Result_Color"></span>

    </div>


    </div>

    </div>

    </div>

    </div>

    </div>



    <script type="text/javascript">

     

    function GetAnimals()

    {

    AnimalService.GetAllAnimals(OnCompleted);

    }

     

    function OnCompleted(items)

    {

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


    }

    </script>

     

    <script type="text/xml-script">

    <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

    <components>

     

    <listView id="Results"

    itemTemplateParentElementId="Results_layout_parent">

     

    <layoutTemplate>

    <template layoutElement="Results_layout" />

    </layoutTemplate>

     

    <itemTemplate>

    <template layoutElement="Result_item">

     

    <label id="Result_Name">

    <bindings>

    <binding dataPath="Name" property="text" />

    </bindings>

    </label>


    <label id="Result_Category" >

    <bindings>

    <binding dataPath="Category" property="text" />

    </bindings>

    </label>

     

    <label id="Result_Color" >

    <bindings>

    <binding dataPath="Color" property="text" />

    </bindings>

    </label>

    </template>

    </itemTemplate>

    </listView>

    </components>

    </page>

    </script>

    </body>

    </html>

    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 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek