Enhance PHP Programming with PHP for Microsoft AJAX Library

Source: Internet
Author: User
Tags php class php and php programming php web development web services zip

First, the introduction

As we all know, the ASP.net Ajax framework consists of three sub frames: asp.net 2.0 ajax extensions,asp.net AJAX Control Toolkit and ASP.net futures CTP. The first two rely heavily on the ASP.net 2.0 server-side technology. In fact, the main design purpose of these two parts is to extend the AJAX features of the ASP.net 2.0 (and later versions) program. In contrast, the ASP.net futures CTP (the previous code is called "ASP.net AJAX Futures CTP") The coupling with the ASP.net server is very small, but it is mainly to serve the development of the ASP.net program, only because the main business logic is transferred from the server to the client, which can greatly improve the client user experience and improve the overall performance of the system.

However, on the other hand, we should also see that the above three sections provide a large number of ready-made JavaScript source code, most of which are concentrated in the ASP.net 2.0 AJAX extensions and ASP.net futures CTP. Most importantly, most of the JavaScript code can be easily detached and applied further to other types of web development platforms. These JavaScript repositories mainly include Microsoftajax.js,microsoftajaxtimer.js and microsoftajaxwebforms.js, as well as ASP.net futures CTP in the Previewscript.js,previewglitz.js and Previewdragdrop.js and so on. Through further analysis, we can easily find that they are all independent JavaScript code, Only its corresponding copy exists in the assembly System.Web.Extensions.dll and Microsoft.Web.Preview.dll in the embedded Resource way. In other words, most of them are independent of the ASP.net server side. Therefore, it is entirely possible for us to migrate these scripts to other server-side web development platforms, such as Jsp,php and Perl. Thus, in the process of developing Web applications based on these server platforms, we can apply ASP.NET Ajax framework client-side technology, including a large number of ASP.net Ajax scripting features, and even more advanced asp.net AJAX client-side framework programming techniques.

However, we should also be soberly aware of the successful implementation of ASP.NET Ajax framework features, especially asp.net The powerful features of Ajax server control ScriptManager and UpdatePanel controls have yet to be exploited with other non-ASP.NET technologies for in-depth simulation.

In this article, we want to explore how to use open Source engineering PHP for Microsoft Ajax Library to introduce the simple Web services technology provided by the ASP.net AJAX client framework into the PHP Web development environment. Although the current open source project PHP for Microsoft Ajax Library has not really matured, we can learn how to introduce the Microsoft Ajax Library on the PHP platform and add popular AJAX features to it.

Second, open source project PHP for Microsoft AJAX Library Introduction

In January 2007, Steve Marx of Microsoft published an Open-source project on the website CodePlex (http://www.codeplex.com/phpmsajax). He tried to introduce Microsoft Ajax Library in the Microsoft ASP.net Ajax framework into the PHP development field.

Below, let's briefly analyze the implementation of the engineering PHP for Microsoft AJAX Library.

So far, the engineering PHP for Microsoft AJAX library contains only two PHP files: msajaxproxygenerator.php and msajaxservice.php. Among them, a PHP class Msajaxservice is defined in the file msajaxservice.php. We can further derive our custom classes from this class to use PHP programming to simulate the implementation of Web services and implement the corresponding Web method definitions. Another PHP class msajaxproxygenerator is defined in another file msajaxproxygenerator.php, through the Generateclientproxy () method of this class and with the help of Microsoft AJAX The library can easily implement the client JavaScript proxy that generates the Web service.

Before we formally analyze This example, let's take a look at the test environment and installation required for this experiment.

Third, download and install the PHP for Microsoft AJAX Library

Open the browser and navigate to the URL http://www.codeplex.com/phpmsajax. All relevant information about this project is available on this site. Note that the latest version of this project is 3 Alpha. When clicking on the HYPERLINK "3 Alpha" in the page, you will be navigated to another page http://www.codeplex.com/phpmsajax/Release/ProjectReleases.aspx?ReleaseId=1692. Figure 1 shows a snapshot of the fragment related to the download project in this page.

Figure 1 Download Open source project PHP for Microsoft AJAX Library

As seen from Figure 1, there are two download options: File phpmsajax.zip or file phpmsajax-nosource.zip. It is recommended to download the former, as it also provides two simple engineering application examples. However, you don't have to have too much hope for both examples, so they're all entry-level.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.