473,509 Members | 11,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ


ASP Includes

By Robert Murdock
Programmer, Darpac Inc.

ASP Includes

As you start creating scripts you will find that there are sections of code that you keep using over and over. Start keeping these in include file. With an include you will be able to just put one line in your new script and use a function or piece of code with out having to cut and paste or re-write it.



File: incdemo.inc

<%

somevar = "This was defined in the include. We use it over
and over<BR>"

Function somefunc()
Response.Write "This is called from a function in the
include.<BR>"
End Function

%>

This is the file that you would actually allow users to execute.

File: incdemo.asp

<!--#include file="incdemo.inc"-->
<%
Response.Write somevar
somefunc()
%>

  ASP Cookies »

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.