Share via


Including Files in Solution Sites

The first step in authoring a new Web page for your site consists of including the appropriate files in the correct order.

Files should be included using the following inclusion directive:

<!-- #INCLUDE FILE="include/filename.asp" -->

The files to be included can be divided into the following six categories:

  1. Response header information and pipeline choice. You should include one of the two files include\header.asp or include\txheader.asp, but not both. The only differences between them is that the file txheader.asp includes the transaction directive "TRANSACTION=REQUIRES_NEW", and they define the global string variable g_sPipelineProgID differently.

    The file txheader.asp defines the variable g_sPipelineProgID as "PooledTxPipeline" and the file header.asp defines it as "PooledPipeline", defining the use of a pooled pipeline with and without transactions, respectively. This variable is passed as the second parameter to the RunPipe method of the OrderGroup object in the file std_pipeline_lib.asp.

  2. Constant definitions, if any. The file include\const.asp is empty as delivered with the Solution Sites, and need not be included unless you add your own constant definitions to it that are used in the file being authored. The constants used by the existing routines in the Solution Sites are defined in the type library named appconsts.tlb. For more information, see Constants and Constants Reference.

  3. Utility routines. There are a number of include files that define utility routines in various functional categories. Depending on the functionality of the page you are authoring, you will probably end up including a fair number of the following files (the files shown in bold font are more likely to be included in every page you author):

include\addr_lib.asp include\std_dates_lib.asp
include\analysis.asp include\std_error_lib.asp
include\catalog.asp include\std_ordergrp_lib.asp
include\form_lib.asp include\std_pipeline_lib.asp
include\html_lib.asp include\std_profile_lib.asp
include\payment.asp include\std_string_lib.asp
include\std_access_lib.asp
include\std_url_lib.asp
include\std_cache_lib.asp include\std_util_lib.asp
include\std_cookie_lib.asp

The presence of these files and the large number of utility routines they provide highlight the importance of learning as much as possible about the functionality they provide. Otherwise, you could end up writing and debugging code that is already provided. For more information about the utility routines, see Utility Routines for Solution Sites and Routines Reference.

  1. Discount processing. The file template\discount.asp should be included if the page you are authoring is meant to display discount banners (as opposed to discounts displayed in the basket). If so, your page should include a line of code similar to the following, which uses the RenderDiscounts routine defined in the file template\discount.asp to initialize the variable htmDiscountBannerSlot defined in the file include\setupenv.asp.

    htmDiscountBannerSlot = RenderDiscounts(ProductAffinity, BasketAffinity, nDiscountsToShow)
    

    The HTML string contents of the variable htmDiscountBannerSlot are then "dumped" to the discount area of the standard page layout in the file template\layout1.asp.

  2. Variable definition and page processing. You must include the file include\setupenv.asp to use the page execution model employed by the Solution Sites. This file creates a large number of global variables, many of which are initialized to values that are stored in the Active Server Pages (ASP) Application object. Code in this file also provides basic functionality required on every page, such as user identification and host name correction. The code on the page ends by invoking a function named Main that serves as the entry point to the page-specific code that provides the HTML that gets rendered as the page you are authoring. For more information, see Implementing the Main Subroutine for Solution Sites.

  3. Page layout. The last file you should include in the page you are authoring should be one of the two files template\layout1.asp or template\no_menu.asp (but not both). The former provides the standard page layout provided with the Solution Sites and the latter provides the more minimal (no menus) layout used in some of the pages within the Solution Sites (for example, welcome.asp and login\login.asp). For more information about the page layouts provided with the Solution Sites, see Page Layout.

    You may determine that your site should use more than the two layouts included with the Solution Sites. In this case, you can develop one or more alternative layout pages, modeled on the files template\layout1.asp and template\no_menu.asp. You would then include an alternative layout page as the last include file on the page you are authoring.

See Also

Page Execution Model for Solution Sites

Copyright © 2005 Microsoft Corporation.
All rights reserved.