Share via


Implementing Support Routines for Solution Sites

The code required to create the page content that is assigned to the variable htmPageContent is often complex enough that good coding practices dictate that you should divide it into multiple routines. The routine Main always serves as the entry point, called by the code in the file include\setupenv.asp. To keep the routine Main from becoming too large and unwieldy, you should often create additional routines that Main calls in the course of performing its job. By convention, these routines typically appear after the routine Main in the page being authored. There are many examples of this in the pages that are delivered with the Solution Sites.

The challenge will be to determine whether the functionality supplied by any supporting routines that you create are specific to the page being authored, or are possibly more general in nature. If they are of the former type, they should be implemented directly in the page being authored. If they are of the latter type, you should create a one or more include files to contain the new utility routines. (Avoid adding new routines to the existing include files so that it is easier to upgrade new releases of the existing files.)

Another challenge is to acquire an adequate understanding of the functionality supplied by the existing utility routines so that you do not spend unnecessary time re-implementing functionality that already exists.

See Also

Implementing the Main Subroutine for Solution Sites

Page Execution Model for Solution Sites

Copyright © 2005 Microsoft Corporation.
All rights reserved.