Page Layout Template File

This section describes the page layout template file in ASP script to be used as an include file for the main ASP script page.

In order for hyBook to be integrated into different Web sites, where each of them may have different page layouts, I have designed the hyBook page to be based on a template include files. Here is how this design works.

1. Each ASP page will have a template include file inserted at the beginning.

2. The template include file provides code to control the page layout.

3. The page layout should have blank blocks where some ASP function calls will be placed.

4. Each ASP page should only implement those ASP functions called by the template.

For example, the following is a template include file in my hyBook demonstration package:

<%
   opening
%>
<?xml version="1.0"?>
<html><head>
<title>hyBook - Demo</title>
<meta name="description" content="Demonstration page of hyBook 
- A simple guest book script"/> 
<meta name="keywords" content="hyBook, Guestbook, ASP">
<link rel="stylesheet" type="text/css" href="hyBook.css"/>
</head><body>

<center>
<%
   outputHeader
%>
<!-- Other HTML or ASP codes -->
<%
   outputBody
%>
<!-- Other HTML or ASP codes -->
<%
   outputFooter
%>
<p>Powered by <a href=http://www.herongyang.com/hyBook/>hyBook</a></p>
</center>

</body></html>
<%
   closing
%>

Note that there are 5 ASP function calls placed in this template:

What goes into the header block, the body block, and the footer block is up to the author of the page. Of course, if you don't use any of those blocks, just implement an empty function in the ASP page.

Also note that a CSS file, hyBook.css, is designed in hyBook to allow you to control the appearance of individual HTML elements.

Table of Contents

 About This Book

 ASP (Active Server Pages) Introduction

 IIS (Internet Information Services) 5.0

 MS Script Debugger

 VBScript Language

 ASP Built-in Run-time Objects

 ASP Session

 Creating and Managing Cookies

 Managing Sessions with and without Cookies

 scrrun.dll - Scripting Runtime DLL

 Managing Response Header Lines

 Calculation Speed and Response Time

 ADO (ActiveX Data Object) DLL

 Working with MS Access Database

Guest Book Application Example

 Design Overview

 Database Tables

 Configuration File

Page Layout Template File

 Guest book Main Script

 The Utility Script Library File

 Data Submission Issues

 Webmaster Administration Page

 References

 Full Version in PDF/EPUB