Thread: Header for ASP

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Guelph
    Posts
    16
    Rep Power
    0

    Header for ASP


    Here's my situation. I'm creating a bunch of ASP pages and want a commom header to be included in all. In this header, I want the name of the page included. This is the cheap way that I'm currently doing it:

    <!--#include file="headstart.htm"-->
    Page Title
    <!--#include file="headend.htm"-->

    where headstart.htm is basically:

    <table border=0 width=600 align="center">
    &nbsp;&nbsp;<tr>
    &nbsp;&nbsp;&nbsp;&nbsp;<td width=20%>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="blah.jpg"></img>
    &nbsp;&nbsp;&nbsp;&nbsp;</td>
    &nbsp;&nbsp;&nbsp;&nbsp;<td width=80% align="center">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Site Name<br>

    and headend.htm is basically:

    &nbsp;&nbsp;&nbsp;&nbsp;</td>
    &nbsp;&nbsp;</tr>
    </table>

    What is the cleanest way to call a header that will be passed the title of the page and have it inserted?

    Please let me know if this is unclear.

    Thanks,
    Anthony
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    17
    Why not write a function? Or two for that matter?
    PHP Code:
    <%
    ' Of course your headers can be a little more detailed. 
    Function makeHeader(title)
      response.write "<html><head><title>" & title  & "</title></head><body>" 
    end function 

    function makefooter()
      response.write "</body></html>" 
    End function 
    %>
    Now on all your pages
     
    <% makeHeader "Page Title " %>

     
    Content
     
    ....
    ....
    ....
    end content

    <% makefooter() %> 

IMN logo majestic logo threadwatch logo seochat tools logo