ASP ClassicLesson 37Free preview
ASP #include
This lesson is part of ASP · All levels
Summary
The #include directive allows one file to be inserted into many Classic ASP pages so that common sections such as header, footer, and menu are written once enough. Include is processed before the script is executed, so that it's as if the contents of the file are stuck directly inside the page. Wise use reduces duplication while simplifying site maintenance.
Key points
- Syntax include: <!--#include file="nama.asp" --> or virtual="/path".
- The path file is relative to the page, virtual relative to the root site.
- Includes execution during preprocessing before the ASP script runs.
- Be careful that paths never form from user input.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.