Directive #code directive Foundation
Controls where code is emitted by the CxcBuilder
The #code directive is used to specify the locality of the code section following the directive. The supported locality tokens are described in the table below. The default locality is "page-render". The CxcBuilder automatically switches back to that locality after it has emitted the code section immediately following a #code directive.
|page-init||Code section is injected at the end of the :Init() method of the page class|
|page-load||Code section is injected into the :Load() method of the page class. :Load() is executed when the page binary is loaded into the worker process.|
|page-unload||Code section is injected into the :Unload() method of the page class. :Unload() is executed when the page binary is unloaded from worker process. This usually occurs before the worker process gets recycled. The exact time is not determined.|
|page-render*)||Code section is injected into the :Render() method of the page class. :Render() is where the HTML output (view content) is created.|
|page-global||Code section is injected into the module header of the page class implementation file. Use this locality for defining your own functions, classes or static declarations. #include statements should also be placed in this locality.|
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.