I’ve been playing with AJAX a lot lately and thought it would be good to post an AJAX example using Delphi for .NET. There are lots of AJAX libaries/frameworks available and the one I’ve chosen for this example is magicAJAX.net. Rather then reinvent the wheel I’ve taken this example and converted it to use Delphi.
I’m going to assume you’ll be running this example from IIS. To get this example to work in Delphi for .NET you’ll need to do the following:
- Grab the magicAJAX.net download from here. All you’re really going to need is the magicajax.dll assembly.
- Download the Delphi example source code here
- Unzip delphi_magicajax.zip into \inetpub\wwwroot (it contains a directory called DelphiMagicAjax)
- Create a virtual directory under IIS and point it at the directory created above
- Under \inetpub\wwwroot\DelphiMagicAjax create a directory called “bin”
- Unzip magicajax.dll from the download in step 1 into the bin directory created above
- Start the IDE and open DelphiMagicAjax.bdsproj
- From the Project Manager right click References and select Add Reference and add magicajax.dll
- Compile and run the project, you should see a page that looks like this
To add the magicAJAX.net panel to your palette:
- Select Component | Install .NET Components…
- Click Select an Assembly and locate magicajax.dll and click OK
For more information check out the magicAJAX.net website.