Databases - Delphi/WebServers - html Tricks

In creating web servers, there are a number of html tricks that were not obvious. This is just a few.

Forms | Referencing Server Actions | Frames | Detail Windows | PathInfo


Forms have their own page.

Referencing Server Actions

Normally, web actions are called using However, when don't include the name of the Delphi program name - only supply the Action_Name.

(Based on the known facts, I assume that this is a feature of the IIS web server and not an issue with Delphi.)

Actually, I've seen it work one way for several hours, then had to change to the other. You must use trial and error to get it right.


There are a number of issues with frames. The main trick here is that even if abc.exe/frame displays the following frame, the included pages are referenced using the exe name. This is because the Browser determines which page is displayed and it does not know the source of the frame definition file. Thus, in an href or src parameter, always include the name of the exe file.

However, when a Delphi web server displays a form, the Action parameter should point to just the PretendDirectory.

This is because the IIS Server sends the post command information back to the program that originally produced the form. (Actually, I am guessing at this because this is the way it works.)

With forms that ARE NOT generated by a server, then the full server name must be included.

Notice that this syntax fails when the form was generated by a Delphi web server and the same server is the target of the post command.

Detail Windows

When showing master/detail type data, it is useful to open the details in a second window without the usual menu, address edit field, buttons, and other typical web browser type ornaments. Sometimes, I prefer the detail window to look more like a dialog box.

The standard anchor tag does not provide this type of control.

will create a new Status_Display window and reuse it for each detail, but all the normal browser ornaments are displayed.

To get better control, you need to use the command in a script. This script/anchor combination will open a second window that looks more like a dialog box.

Notice that even though a script is being called, an href parameter is still required to make the hyperlink display underlined and to have the cursor change to a hand. In this case, table refers to a web server action. Unfortunately, this adds the current page to the browser history list each time a link is clicked.

Combining the 2 methods (where both the OnClick and href point to the same web page) seems to solve both problems.

This is the Delphi command to generate the html (folded to make it readable)



It is also possible (and perhaps, desirable) to call the subroutine without a url - I have verified that this also works ... and it SHOULD cause the page to be transmitted only once. (With normal caching, it was probably transmitted only once anyway ... but placed twice in the web log.)

If the href file is not found, the window is opened with the blank page displayed.


The web server action (PathInfo) can be determined via

Those lines display the following in the debug trace

Author: Robert Clemenzi -
URL: http:// / user / clemenzi / technical / Databases / Delphi / WebServers / html_tricks.html