Enabling and Disabling Action Items

From RAD Studio
Jump to: navigation, search

Go Up to Determining When Action Items Fire


Each action item has an Enabled property that can be used to enable or disable that action item. By setting Enabled to False, you disable the action item so that it is not considered by the dispatcher when it looks for an action item to handle a request.

A BeforeDispatch event handler can control which action items should process a request by changing the Enabled property of the action items before the dispatcher begins matching them to the request message.

Warning: Changing the Enabled property of an action during execution may cause unexpected results for subsequent requests. If the Web server application is a DLL that caches Web modules, the initial state will not be reinitialized for the next request. Use the BeforeDispatch event to ensure that all action items are correctly initialized to their appropriate starting states.

See Also