Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3933738
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:38:07+00:00 2026-05-19T23:38:07+00:00

Has anyone successfully used the AJAX-enabled ASP.NET Web Application wizard in Delphi 2007 to

  • 0

Has anyone successfully used the AJAX-enabled ASP.NET Web Application wizard in Delphi 2007 to make ajax calls? If so, what’s the secret to making it work.

I ask for two reasons. First, what I have tried does not seem to work. Second, I have searched the Web extensively and have seen no examples or discussions that imply that the AJAX actually worked in Delphi 2007 with ASP.NET 2.0.

Here’s what’s going on. I built an AJAX enabled C# application (and a corresponding C# Web service) using .NET 4.0. It was all pretty straightforward, and it is working as it should be.

I would like to call those same WebMethods from a Delphi 2007 ASP.NET application. Unfortunately, while the C# client receives the strings returned from the various WebMethods from the Web service, the Delphi 2007 client receives [object Object], and it appears to have two undefined properties. I say this because the following code, when used to receive the result, displays an alert window displaying “undefined undefined.”

function ShowObjectInfo(result) {
var Name;
var str;
  for (Name in result) {
    if (typeof  result[name] !== 'function') {
      str = str + ' ' + result[name] 
    }
  }
  window.alert(str);
}

Here is the most simple example I could put together. Here is my ASPX file:

<%@ Page language="c#" Debug="true" Codebehind="Default.pas" AutoEventWireup="false" Inherits="Default.TWebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head runat="server">
    <title>Keeping it simple</title>
    <script type="text/javascript">
      function OnLookup()
      {
        WebService.Echo('repeat after me', OnLookupComplete, OnError);
      }

      function OnLookupComplete(result)
      {
        window.alert('Success :' + result);
      }

      function OnError(result)
      {
        window.alert('Error ' + result);
      }
    </script>
  </head>
  <body>
    <form runat="server">
      <asp:ScriptManager id="ScriptManager1" runat="server">
        <Services>
          <asp:ServiceReference path="../../statisticsservice/statisticsservice.asmx"></asp:ServiceReference>
        </Services>
      </asp:ScriptManager>
      <asp:UpdatePanel id="UpdatePanel1" runat="server"></asp:UpdatePanel>
      <input value="Button" type="button" onclick="OnLookup();">
    </form>
  </body>
</html>

It is clear that the Web service is actually executing, since calls to more process intensive WebMethods takes longer to return. Nonetheless, what I see after execution from the Delphi application is an alert window that contains “Success : [object Object]”

So, to repeat the question, has anyone successfully used the AJAX-enabled ASP.NET Web Application wizard in Delphi 2007 to make ajax calls? If so, what’s the secret to making it work.


After inspecting the value returned in the callback functions (based on the use of FireFox and FireBug as Wouter suggested), the following is the fix to the JavaScript in the simple example.

function OnLookup()
{
  WebService.Echo('repeat after me', OnLookupComplete, OnError);
}

function OnLookupComplete(result)
{
  window.alert('Success :' + result.d);
}

function OnError(result){
  window.alert('Error ' + result._message);
}
</script>

A couple of notes. First, I still do not know why the returned string is found in a property named d, but at least it works. Second, it is better if you place your JavaScript functions and variable declarations in a file separate from your HTML. When you do that, you refer to the external JavaScript file or files in the Scripts property of the ScriptManager. I included the JavaScript in the HTML file here for simplicity.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:38:07+00:00Added an answer on May 19, 2026 at 11:38 pm

    Nobody’s answered this one yet, so let me at least try to help out in one way or the other.

    The ShowObjectInfo function above makes me think that you’re not using FireBug at the moment.

    To speed up the debugging-process, you could do this:

    1. Make sure you’ve got FireFox and FireBug installed;
    2. Press F12 to show the FireBug pane;
    3. Load your web page
    4. Go to the firebug script tab;
    5. Add a breakpoint at the line where you’re calling alert, by clicking in the gutter area;
    6. Refresh the page;
    7. Inspect the result variable to see what you’ve got.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone successfully used hudson to build .Net 1.1 Projects? If so, can you
Has anyone successfully used Tokyo Cabinet / Tokyo Tyrant with large datasets? I am
Has anyone successfully used the above statement to catch the exception before it goes
I'm working on a JavaScript application that has to perform two separate checks via
I have contact management / CRM application used in-house by our company, It is
I have an ajax toolkit TabContainer control on my page with a couple tabs.
I am doing my second Facebook connect site. On my first site, I used
I'd like to access some Google API's from within an iPhone native app. I'm
This is a follow up to a previous question that I had before about
I am using the ajaxform() plugin, which so far is working well. However, my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.