View Full Version : Templates using include and server.execute()

02-27-2007, 01:45 PM
Ok so you can use an include file for template purposes which works well, and you can pass varibles between the include file, because, it merges the two files before execution and you can execute external documents using server.execute and them merge the files together. So obviusly they can both be used for templates. Both of them have their advantages and disadvantages, i was wondering if there was of passing varibles to and from a page being executeded using "server.execute"? any ideas?

02-27-2007, 08:11 PM
When Server.Execute is executed by the server, the page context remains the same, meaning you can still access the same Request object as if you were in the calling page. I think you can still access the global variables declared in the calling page from the target page. The overall effect is very similar to a function or subroutine call.

02-28-2007, 02:38 PM
A page "included" using Server.Execute will not have access to variables set in the calling page.