ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

Using authorization headers
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Quick Tips

Improve efficiency with server-side includes
Many web sites consist of repetitive information, such as headers, or content that rotates on a regular basis, such as a Tip of the Week. By using server-side includes, you can reduce the repetitiveness and some of the hassle that comes with rotating content, and your code will look much leaner as a result. A server-side include works in much the same way as the C/C++ #include directive, telling ASP to insert the contents of the specified file in place of the include. Your include file can contain HTML, server-side script, client-side script, or anything else you'd normally find in an Active Server page. The syntax looks like this:

<!--#include virtual="header.asp"--> There are two flavors of includes--file and virtual. When using the file include, you must specify the file's path in relation to the including file. With the virtual include, however, you must specify the file's path in relation to the virtual root. Therefore, if the folder myweb is in your virtual root, and your file structure looks like this: myweb\pages\default.asp myweb\includes\header.asp you'd use the following statements for file and virtual includes, respectively. <!-- #INCLUDE FILE="../includes/header.asp" --> <!-- #INCLUDE VIRTUAL="/myweb/includes/header.asp" -->
Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers