Print Page | Close Window

Possablity of Dynamic Include in ASP!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10933
Printed Date: 31 March 2026 at 1:22pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Possablity of Dynamic Include in ASP!
Posted By: neotrix
Subject: Possablity of Dynamic Include in ASP!
Date Posted: 20 June 2004 at 5:02am

Just an idea that poped my mind, thought i'd finish up this long never ending discussion once & for all.

well, the alograthem goes like this....

<%
suppose myfilename="somefile.asp"
create a new file in "temp/file_to_include.asp"
writeline "<!-- include file=""/includes/" & myfilename & """ -- >"
%>
<!-- include file="temp/file_to_include.asp" -->



shud this work ???



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..



Replies:
Posted By: neotrix
Date Posted: 20 June 2004 at 8:25am
NOT TESTED (*dpyers Style*)

-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: Gullanian
Date Posted: 20 June 2004 at 8:36am
Errrr..... Yeah!  But I don't really see the point in it...


Posted By: neotrix
Date Posted: 20 June 2004 at 9:34am
Dynamic include was really a big prob .. i mean one of the "MOST" frequently asked question in almost all of the ASP discusion boards... WEB WIZ FORUMS found the answer... isent it great ?

-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: Mart
Date Posted: 20 June 2004 at 5:21pm

No it won't work, otherwise the dynamic include problem would be solved.

Includes are exectued BEFORE any ASP scripts, which means that ASP will response.write all the includes too late - includes would have already been loaded



Posted By: ljamal
Date Posted: 20 June 2004 at 8:49pm
Actually it works, but you would get the last include generated included on the file, not the most current one.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: neotrix
Date Posted: 21 June 2004 at 1:11pm

Meanz its useless

Who will like to include a PREVIOUS File ?? NO possible situation can need to include a previous file.



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: ljamal
Date Posted: 21 June 2004 at 5:06pm
Useless yes, but it does work

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Semikolon
Date Posted: 26 June 2004 at 4:53pm
it will do it if you reload the page after the include file is written..

but you can't use the same file for all users, as all users would then get the same include, and what is then the reason for using dynamic includes? you coul duse unique user IDs in the filenames, but then you will need dynamic includes to include the file with the dynamic included file, which means you would get an infinite loop of your script


Posted By: Semikolon
Date Posted: 26 June 2004 at 4:55pm
I'm quite sure there will never be a good solution for this problem in ASP, unless someone writes a component for it, but that may not be a good solution either


Posted By: neotrix
Date Posted: 26 June 2004 at 6:15pm

Originally posted by Semikolon Semikolon wrote:

it will do it if you reload the page after the include file is written..

but you can't use the same file for all users, as all users would then get the same include, and what is then the reason for using dynamic includes? you coul duse unique user IDs in the filenames, but then you will need dynamic includes to include the file with the dynamic included file, which means you would get an infinite loop of your script

the creation of a file/ and then the reloading of the page (using Response.REdirect) will hardly take 2 seconds, of if you elongate it.. say 5 seconds.... which site will have enuf traffic in wich more tha 1 guy is visiting his page at the rate of users/second ?? I can't think of any one....

so that's not a point



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: Semikolon
Date Posted: 27 June 2004 at 6:54am
if you take for example this forum, forum_posts.asp, don't you think it has more than one execution per second?


Posted By: Mart
Date Posted: 27 June 2004 at 7:20am
Face it, if your site takes too long to load visitors just won't bother. And we are talking seconds too long so an extra 2 seconds is worse than you think


Posted By: pmormr
Date Posted: 27 June 2004 at 5:31pm
dynamic includes again !! (loads desert eagle, points at head, fires)

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net