How to Include an ASP File in HTML

by Michael Dance

ASP, which stands for Active Server Pages, is a server-side scripting engine built by Microsoft. Though Microsoft now uses the web application framework ASP.NET, which uses the newer ASPX extension, ASP files are still being written for the web every day. A typical ASP file contains basic HTML code but may also include scripts that can be executed on a server. Once you understand this basic functionality, using ASP's built-in "include" function to include an ASP file inside an HTML file is simple.

Steps

Open the HTML file in which you want to place the ASP file.

Insert the following code where you wish to include the separate ASP file: <!--#include file="filename.asp"-->

Make sure the separate ASP file exists in the same directory as the HTML file, or alter the file path as necessary. For example, if the HTML file exists in the root directory, and the ASP file exists in a subdirectory called "sub," you would need to write: <!--#include file="sub\filename.asp"-->

Save the HTML file with an ASP extension so that your server will recognize that it has an ASP call in it.

Items you will need

References

About the Author

Michael Dance is a freelance writer and the owner of MovieCultists.com. As a film critic for TheCinemaSource.com he has been quoted by RottenTomatoes.com and in national ad campaigns. He graduated from NYU's Tisch School of the Arts in 2007 and currently lives in Washington D.C.