OnInclude Event


Applies to

THtmlViewer, TFrameViewer, and TFrameBrowser components

Declaration

property OnInclude: TIncludeType;

Description

The OnInclude event allows text to be inserted in an HTML document at load time. Within the HTML document, the OnInclude event is generated when server side include syntax is encountered. See the TIncludeType for more information on the parameters and on the server side include syntax.

Example

The OnInclude handler below could be used to fill in the current date in an HTML document

procedure TForm1.DoInclude(Sender: TObject; const Command: string; Params: TStrings;

var S: string);

begin

if CompareText(Command, 'Date') = 0 then

S := DateToStr(Date)

Params.Free;

end;

In the HTML document, the following would be replaced in its entirety by the generated string.

<!--#date -->