Important alert: (current site time 7/15/2013 11:19:29 PM EDT)
 

winzip icon

Advanced Dynamic File Include

Email
Submitted on: 12/6/2003 6:33:21 PM
By: Michael Tanczos  
Level: Intermediate
User Rating: By 9 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 15932
(About the author)
 
     Are you looking to do true dynamic ASP includes? I'm not talking about just printing out the contents of some other file.. or running a script through server.execute. I'm talking about actual dynamic ASP includes that allow you to include an ASP just like you would do with SSI calls. Based off of the excellent work of Don Selkirk. This contribution is my own modifications and is submitted in the spirit of open source. This is for VBScript only! If you like it take a few seconds and vote.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/7/2003 12:48:02 AM

I've used this and it works great.
(If this comment was disrespectful, please report it.)

 
12/21/2003 12:52:38 PM

Thanks for the great insight to printing in ASP.
(If this comment was disrespectful, please report it.)

 
4/5/2004 2:34:10 PMmarkhazleton

I like the improvements, thanks for the contribution.

A minor nit, I would like a version that declares all the variables up front as I always try to use "Option Explicit" for all code on my site, I had to add 13 variable declarations. not a big deal, just a coding practice that helps in debugging (IMHO).

(If this comment was disrespectful, please report it.)

 
10/29/2004 6:34:15 AM

Hi,
It works! Thanks for the code!
But I have two comments:
1. The escape of the the
(If this comment was disrespectful, please report it.)

 
10/29/2004 6:35:35 AM

Hi,
It works! Thanks for the code!
But I have two comments:
1. The escape of the the "'" with the danish character æ did not work for me, but replacing all the æ in the code with "æææ" made the trick

2. A version of the code where input is a string (from a DB) instead of a file would be nice.
something like:
cls_include.execute(str)

By the way: I am from Denmark!
(If this comment was disrespectful, please report it.)

 
3/1/2005 7:54:23 AM

Great code but I hit a error when calling the function twice in the same page. Files being included contained raw HTML with no ASP tags, so nothing tricky. Error was: "Microsoft VBScript runtime error '800a01c9'

This key is already associated with an element of this collection "

Any ideas on how to fix??

Also would be great if error code returned if include file not found...

(If this comment was disrespectful, please report it.)

 
3/1/2005 8:58:26 AM

After much debugging, solution to problem of "key already associated" was a syntax error for CLASS Disposal.

Find "private sub class_deactivate()" and rename to:

private sub class_terminate()

Cheers K
(If this comment was disrespectful, please report it.)

 
9/11/2006 3:42:27 AMNguyen Manh The

Oh...Thanks you very much.
I'm from Vietnam.
Welcome to you !!!
(If this comment was disrespectful, please report it.)

 
10/13/2007 8:06:54 PMGoksah TASYUREK

perfect. thanks for share. Great job.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.