Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to issue dynamic include in asp-classic?

I mean, like php'h include...

something like

my_file_to_be_included = "include_me.asp"

-- >

for what I've seen so far, there are a couple of alternatives, but every one of them has some sort of shortcoming...

what I'm trying to figure out is how to make a flexible template system... without having to statically include the whole thing in a single file with a loooooong case statement...

here there are a couple of links

a solution using FileSysmemObject, just lets you include static pages

idem

yet another one

same thing from adobe

this approach uses Server.Execute

but it has some shortcomings I'd like to avoid... seems like (haven't tried yet) Server.Execute code runs in another context, so you can't use it to load a functions your are planning to use in the caller code... nasty...

same thing

I think this one is the same

this looks promising!!!

I'm not sure about it (couldn't test it yet) but it seems like this one dinamycally handles the page to a SSDI component...

any idea???

like image 297
opensas Avatar asked Jan 26 '09 11:01

opensas


1 Answers

No you can't do a dyanmic include, period.

Your best shot at this is a server.execute and passing whatever state it needs via a Session variable:-

Session("callParams") = BuildMyParams() 'Creates some sort of string
Server.Execute(my_file_to_be_included)
Session.Contents.Remove("callParams")
like image 149
AnthonyWJones Avatar answered Oct 05 '22 07:10

AnthonyWJones