An AJAX example in Delphi with ASP.NET using AJAX.NET Professional

Back in January, I wrote this
about using the framework in Delphi to illustrate AJAX from a Delphi ASP.NET application. This
month I’ve been looking at the AJAX.NET Professional framework
written by Michael Schwarz and
have converted his examples to Delphi for .NET using the 1.1 .NET framework
although AJAX.NET Pro supports both 1.1 and 2.0 versions of .NET.

Once again 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:

  1. Grab the AJAX.NET Pro net download from here. All
    you’re really going to need is the AjaxPro.dll assembly.
  2. Download the Delphi example source code here
  3. Unzip into \inetpub\wwwroot (it contains a directory
    called DelphiAJAXDemo)
  4. Create
    a virtual directory
    under IIS and point it at the directory created above
  5. Under \inetpub\wwwroot\DelphiAJAXDemo create a directory called “bin”
  6. Unzip AjaxPro.dll from the download in step 1 into the bin directory created
  7. Start the IDE and open DelphiAJAXDemo.bdsproj
  8. From the Project Manager right click References and select Add Reference and
    add AjaxPro.dll
  9. Compile and run the project, you should see a page that looks like this

NOTE: I intentionally converted this example as closely to the C# example as
possible. I can’t say that in all cases I would have written the same code but I
felt the comparison between C# and Delphi was important enough to keep the code
as similar as possible.



I found a bug in the Class demo code where some
data members were not being initialized. I’ve corrected the code and fixed the
download with these latest changes.

Update #2:

I missed the file quickguide.aspx which is
now included in the download.

Update #3: Fix blog tags for this entry

Update #4: This demo is now available online here.