RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWebActionItem.OnAction Event

Occurs when TWebDispatcher matches the action item to a newly-arrived HTTP request message.

Pascal
property OnAction: THTTPMethodEvent;
C++
__property THTTPMethodEvent OnAction;

Write an OnAction event handler to respond to HTTP request messages that match the MethodType and PathInfo properties. OnAction occurs immediately after the response message's Content property has been initialized by the action item's Producer property (if Producer is set). 

In an OnAction event handler, read Request and perform the requested Method if possible. Set the properties of the Response parameter as appropriate. If the OnAction event handler does not service the response, or if it only partially handles the request and must let another action item finish the response, set the Handled parameter to false.  

An OnAction event handler can call the SendRedirect or SendResponse method of Response to send the HTTP response message to the Web client. If the OnAction event handler does not send the response, the Web application will send it after all action items have finished filling in the Response.

Tip: The OnAction event handler can use descendants of TCustomContentProducer to help assemble the contents of the response message.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!