
August 23rd, 2004, 02:36 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Location: Minneapolis, MN
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Use server.execute
I bashed my head against a wall for days trying to do this. I found that if you are using asp 3.0 you can use the server.execute function which will transfer controll to the included page, but you will not be able to use any data from the page you are including the file from.
You are probably past this problem already, but this may help others in the future.
Quote: | Originally Posted by mattz0r Hey all,
I'm in a bit of a pickle!
I want to include an ASP file in an ASP file. The ASP file that's being included has a dynamic name dependent on a querystring variable.
ie the file being included would be request.querystring("content")+".asp"
I have a function that copies code from a file into a variable, and I can response write that, however it doesn’t execute the asp code, because it uses the virtual path (Server.MapPath):
3rd party code :
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objText = objFSO.OpenTextFile(Server.MapPath(strIncludeFile) ) With this variable containing asp code, can I include that somehow in <% %> of the main asp file? – ie so it will get executed as well as use other variables in that main asp file?
Is there a way to include include code into an asp file then have that executed? Keeping in mind that included asp files’ names are generated from a querystring variable.
I hope I’m making sense here, and I would massively appreciate it if anyone could help this noob out!
Cheers,
Matt |
|