Categoriesclassicasp

Classic ASP Page Lifecycle

I’ve always found myself looking up the Page Lifecycle of frameworks. It is useful when debugging and adding new features. Classic ASP is no different. Once a request is identified by IIS (Internet Information Server) to be a “.asp” request, the specific page is identified and the following flow occurs.

  1. Initialization:
    The ASP engine initializes the objects we have come to love (or hate): Request, Response, Session, and Application.
  2. Script Execution:
    The server processes the ASP script from top to bottom. It executes server-side code within <% %> tags, such as VBScript or JScript, generating HTML or other output to send to the client. This is where we open/close databases and file resources.
  3. Response Generation:
    After the script has been executed, the HTML generated from it is sent sent to the Response object, which accumulates the content. Other things such as headers and cookies can be modified before the output goes out.
  4. Response Sent to Client:
    The ASP engine then sends the response to the client.
  5. End of Processing:
    Expensive server-side objects like Session, Application, Request, Response, and Server are released, and any resources used by the script are freed.

In summary, the Classic ASP lifecycle is simple but a legacy dev needs a foundational understanding of it in order to work with legacy apps.

Leave a Reply

Your email address will not be published. Required fields are marked *