Build Logo Programming Web Sites
Integrating Includes and Subs on Single Page Sites

The Build Team - Specializing in "Proof of Concept" applications

Home | Single I | Single II | Single III | RAD I | RAD II | Program Site
Alliance Logo
Home
    Single Page Web Sites
    RAD Applications

    Message Board
    Index.asp code

  Down load this
  example web site


New Page 1

<%@ LANGUAGE = VBScript %>
<%

'
NOTE - I have used includes on this page so that the code can run on PWS and IIS 4.0
' server.execute should be used if your server supports it.

Option Explicit
Response.Buffer = True
Response.ContentType = "text/html; charset=iso-8859-1"

'-------------------------------------
'--- Declarations
'-------------------------------------

Dim strNav
Dim strPage
Dim strHead

Dim strDBPath
Dim objConn

Dim strDecomp ' variable used in main.asp

'-------------------------------------
'--- Initialization
'-------------------------------------

strNav = request("nav")
strPage = request("page")
strHead = request("head")

If adCmdText = "" Then
Const adCmdText = &H0001
End If

'-------------------------------------
'--- Body
'-------------------------------------
%>


<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Programimg Web Sites</title>

<LINK REL=stylesheet HREF=
"StyleSheet.css" TYPE="text/css">

<!-- These two includes would normally have been combined into one include file, with parameters 
being passed instead of having identical subs with different names, but the RAD/include.asp 
needed to stay as true as possible to the include.asp from the original tutorial. -->

<!--#include file="RAD/include.asp" -->
<!--#include file="include.asp" -->


</head>

<body topmargin=
"0" leftmargin="0">

<%
Dim strBG
If strNav = "main" Then
     strBG = "images/paper.jpg"
ElseIf strNav = "RAD" Then
     strBG = "images/bgRight.jpg"
Else
     strBG = "images/bgLeft.jpg"
End If
%>


<table width="780" background="<%= strBG %>">
<tr>

<% If strNav = "RAD" Then%>
     <td colspan="2" height="120" bgcolor=yellow>
<% Else %>
     <td colspan="2" height="120">
<%End If %>

<% If strHead = "main" Then %>
     <!--#include file="inc_header.asp" -->
<% ElseIf strHead = "single" Then %>
     <!--#include file="inc_Head_Single.asp" -->
<% ElseIf strHead = "RAD" Then %>
     <!--#include file="inc_Head_RAD.asp" -->
<% Else %>
     <!--#include file="inc_header.asp" -->
<% End If %>
</td></tr>
<tr><td width="160" valign=top>

<%
' If the message board or the showIndexCode is called, we then add this link to take us home
If strPage = "message" Or strPage = "indexCode" Then %>

     <a class=nav href=index.asp?head=main&nav=main&page=main><b>Home</b></a><br>
<% End If

' Here we decide which left navigation menu to display
If strNav = "main" Then
%>

     <!--#include file="inc_mainNav.asp" -->
<%
ElseIf strNav = "single" Then
%>

     <!--#include file="inc_singleNav.asp" -->
<%
ElseIf strNav = "RAD" Then
%>

     <!--#include file="inc_RADNav.asp" -->
<%
Else
%>

     <!--#include file="inc_MainNav.asp" -->
<%
End If
%>

</td><td width="610" valign=top>
<%

' Here we decide which content page to display
' **********************************

If strPage = "main" Then
%>

     <!--#include file="Main.asp" -->
<%
ElseIf strPage = "message" Then
     MessageBoard() ' this sub is found in include.asp
ElseIf strPage = "indexCode" Then
%>
     <!--#include file="showIndexCode.asp" -->
<%

' ******************************************

'  Single Page Web Sites pages

ElseIf strPage = "SingleMain" Then
%>

     <!--#include file="SingleMain.asp" -->
<%
ElseIf strPage = "SinglePageOne" Then
%>

     <!--#include file="SingleOne.asp" -->
<%
ElseIf strPage = "SinglePageTwo" Then
%>

     <!--#include file="SingleTwo.asp" -->
<%
ElseIf strPage = "SinglePageThree" Then
%>

     <!--#include file="SingleThree.asp" -->
<%
' ******************************************

' The RAD pages

ElseIf strPage = "RADMain" Then
%>

     <!--#include file="RADMain.asp" -->
<%
ElseIf strPage = "template" Then
%>

     <!--#include file="template.asp" -->
<%
ElseIf strPage = "form" Then
%>

     <!--#include file="RAD_form.asp" -->
<%
ElseIf strPage = "addtext" Then
%>

     <!--#include file="RAD_AddText.asp" -->
<%
ElseIf strPage = "after" Then
%>

     <!--#include file="RAD_After.asp" -->
<%
ElseIf strPage = "afterInc" Then
%>

     <!--#include file="RAD_AfterInclude.asp" -->
<%
ElseIf strPage = "demo" Then
%>

     <!--#include file="RAD/index.asp" -->
<%
Else
%>

     <!--#include file="Main.asp" -->
<% End If %>

<!--#include file="inc_footer.asp" -->

</td></tr>
</table>

</body>
</html>

Other articles:

Michael Brinkley - Janurary 2, 2002
Send comments to: Mbrink1111@yahoo.com