Amazon.com Widgets

Microsoft Ajax Library on PHP

A reader asked about the reference to running part of ASP.NET AJAX on PHP\Apache in my recent interview... The specific thing I was talking about was running the Microsoft Ajax Library on PHP...

Check out the CodePlex project.. Feel free to jump in and contribute to it.

http://codeplex.com/phpmsajax 

Here is the "hello, world" for this project..

<?php
 
require_once '../../dist/MSAjaxService.php';
 
class HelloService extends MSAjaxService
{
    function SayHello($name)
    {
        return "Hello, " . $name . "!";
    }
}
 
$h = new HelloService();
$h->ProcessRequest();
 
?>

index.html:
<html>
<head>
<title>Hello, World!</title>
<script type="text/javascript" src="../../MicrosoftAjaxLibrary/MicrosoftAjax.js"></script>
<script type="text/javascript" src="HelloService.php/js"></script>
</head>
<body>
Name: <input id="name" type="text" />
<input type="button" value="Say Hello" onclick="button_click(); return false;" />
<br />
Response from server: <span id="response"></span>
</body>
<script type="text/javascript">
    function button_click() {
        HelloService.SayHello($get('name').value, function (result) {
            $get('response').innerHTML = result;
        });
    }
</script>
</html>

Oh, and if you are interest in PHP, you might want to check out the FastCGI work on IIS to make PHP rock on IIS7.

Enjoy!

Published 04 March 07 01:32 by BradA

Comments

# PohEe.com said on March 4, 2007 6:54 PM:

If it works in PHP, then it works excellent for me in my Wordpress project.

# Tim Jarvis said on March 4, 2007 9:38 PM:

Hi Brad,

Firstly in the interests of disclosure, I work for CodeGear. I don't want to hijack your blog for marketing, thats not my intent, but i think this is very relevant to your post, have you seen this yet http://www.codegear.com/Products/Delphi/DelphiforPHP/tabid/237/Default.aspx this (about to be released) product is going to rock the php/ajax world.

# Eric Ramseur said on March 5, 2007 2:57 PM:

Why not just use Phalanger and run any .NET code [ ajax included] in Php and vice versa?  They've put the php lib into a .NET language.

Refer : http://tinyurl.com/24xo46

# Tobin Titus Blog said on March 5, 2007 4:47 PM:

As you may know, we have already announced that the IIS team was working with Zend to improve PHP performance

# Sagi Arsyad said on March 6, 2007 2:15 AM:

beberapa hari lalu, IIS meng-announce kerja sama dengan Zend Team untuk meningkatkan performa PHP di

# Dflying Chen said on March 9, 2007 9:50 PM:

摘要本期共有10篇文章:在ASP以及非ASP.NETURL中使用ASP.NET安全验证在PHP中使用MicrosoftAjaxLibraryOrcas版本C#语言的新特性:自动属性、对...

# Max Shumov said on May 9, 2007 2:47 PM:

" Oh, and if you are interest in PHP, you might want to check out the FastCGI work on IIS to make PHP rock on IIS7. "

Thanks! I've just started to study PHP and I think that the more articles I'll read, the better it'll be for my styding. Am I right?

# Nikolay I. said on May 10, 2007 1:14 PM:

>I think that the more articles I'll read, the better it'll be for my styding. Am I right?

Yes. You're absolutly right! I'm studying php for half year, and I should say that I have confronted with difficulties, because I had wery few articles.

# Jacky_xu said on November 16, 2007 2:13 AM:

本期共有10篇文章: 在ASP以及非ASP.NETURL中使用ASP.NET安全验证

在PHP中使用MicrosoftAjaxLibrary

Orcas版本C#语言的新特...

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker