Include File With ASP
ASP Server-Side Include File (SSI File)
include file is a good way to write code once, which will be repeated
over several Web pages, such as making a uniform header. The include file
can contain HTML, and both client-side or server-side scripts, and images,
and will have the extension of either .inc or .asp. (If using ASP code
in the SSI file, the SSI file will have to use the .asp extension. If
not using the ASP code in the SSI file, either extension is fine.) The
include file is stored outside of the Web pages but will be called from
any Web page having the .asp extension. If you store the SSI file in a
folder just for your SSI files, be sure to use the relative path (url)
when calling it from a Web page situated in a different folder:
to call the include file, where you want it used in the page; from within
a table, a header, a footer area, etc. More than one server-side include
(SSI file) may be called from an ASP page.
= "vbscript" %>
width ="600" border="0" cellspacing="0"
In this example,
you can see that you would have to code the table each time the include
file is called. Instead of repetively coding the table, just include the
entire table right in the SSI file so that the table code is not repeated
on each page. The benefit of having tables inside the SSI file is that
you only have to redesign a table once, to have it appear site-wide. This
will save consider time on site maintenance. If a logo is in the header
of your Web page, you can change the logo in the SSI file without having
to change any other code on your Web site.
TIP: Avoid using .inc as filename e.g. 'top.inc' as this will enable people to download your include file. Using top.asp for example will ensure that the file is not downloaded.
Have many small include files instead of one large one and only include
the relevant include files, this will ensure faster download of pages.