
The control flow of a page is displayed in the following graphic:

You do not have to use all event handlers, for example a BSP can consist of just the layout, or it only contains the layout, OnInitialization and OnInputProcessing.
Since event handler OnDestroy is used infrequently, it is irrelevant here.
The following cases should be distinguished:
stateless BSPs
stateful BSPs
See also:
Stateless
n the stateless case, the context is created each time that a request is received. The context is always destroyed when the response is sent.
For the BSP runtime stateless means: runtime->keep_context = 0
When creating the output of a page, processing is the same as described in the following graphic.
Output of a BSP (Stateless)

When creating the input for a page, processing is the same as described in the following graphic.
Input for a BSP (Stateless)

With stateless BSPs (the default is stateless), the navigation can be executed either on the same page or on other pages.
Navigation Within the BSP
When the page is called, the system first checks if there is already a page object for this BSP. If this is not the case, the event handler OnCreate runs, which creates the page object or an instance of it. The event handler OnRequest then follows. If a page object already exists (in general, this does not happen with the first call, just as little as in stateless BSPs), the system branches directly to the event handler OnRequest. There then follows either OnInitialization, if there is no user interaction, and OnInputProcessing if there is user interaction. From OnInputProcessing, there is no further navigation to OnInitialization. Processing continues with the layout and then possibly with OnManipulation, although this event handler is used infrequently. The requested page is then displayed in the browser. User action can now take place, and then processing begins again.
Navigating to Other BSPs
The processing process is very similar to when you navigate within a BSP. If you now navigate from the OnRequest to a different page, event handler OnInputProcessing is called and evaluated. The follows OnInitialization, and then the layout and so on.
Stateful
In the stateful case, the context is held by gone request to the next.
For the BSP runtime stateful means: runtime->keep_context = 1
When creating the output of a page, processing is the same as described in the following graphic.
Output of a BSP (Stateful)

When creating the input for a page, processing is the same as described in the following graphic.
Input for a BSP (Stateful)

With stateful BSPs, there can be three different variants of lifetime:
Up to the page change (lifetime_page)
The page is destroyed if a different page is used.
For the duration of the request (lifetime_request)
The page is destroyed after each individual request, that is, is only available for the duration of each request.
For the duration of the session (lifetime_session)
The page is destroyed at the end of the session.