Get Started!

Request LifeCycle

An overview of a NetCanvas Section Request.


When an in bound request matches a Route / Slug for a section the Standard NetCanvas Request LifeCycle is executed; below is an outline of the LifeCycle for a standard NetCanvas Request.


These are the steps in the Request LifeCycle

  1. Section is Matched from the Requested Route / Path / Slug.

    • The Relevant Section for the given route is found from the database of sections.

    • If no Route is matched the page will 404.

  2. The Session object is prepared

    • The Session is extracted and if the request is the first for a session, a NetCanvas Session Object is prepared.
  3. Access Rights for the Session is Checked.

    • Each Section has an optional Access Rights property that defines the Minimum User Role that can view a page. If the user's role is not sufficiently high they are redirected to the Login page.
  4. Extract & Execute DataSources

    • Every SelectDataSource Control added to the Section's list of Controls is located and executed.

    • Depending on the MODE different DB methods are executed. Normally, the MODE is VIEW this Reads the Data Out from the DataBase. The same applies to the EDIT mode; when the editor is enabled.

  5. Fill the Zones / PlaceHolders

    • The Section's Template (AKA Layout) is loaded into the ASPX's PlaceHolder : <asp:PlaceHolder ID="template" runat="server"></asp:PlaceHolder> This is the "Top level" template.

    • The Template is processed by :

    • Finding each <n4:CavnasPlaceHolder> in the template.

    • The controls for the section are then located for each of the placeholders found in the template. This is achieved by matching the ID of the placeholder to each of the Controls in the Section. Sorted by their order found in the Designer.

    • Added to the Set of Controls for the section are the Persistent Controls found with the same ID for their location.

    • Each of the Controls is then reflected, and added to the PlaceHolder location.

    • If the control is of type TemplateControl then as soon as it's been appended to the PlaceHolder, it and any controls defined within are processed before the next control is processed.

  6. Special SAVE Mode

    • When the user clicks "Save" in the Editor the Request is executed in the MODE SAVE. This steps through all of the loaded controls and Executes the initialize_SAVE method. Before Writing the changes back to the DataBase and Redirecting the request to the "VIEW" mode of the current URL.