How to Include an ASP File in HTMLby 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.
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
- link W3 Schools
Click here to provide feedback on this article