I've read the 4guys site for years and the articles have helped me out on many occasions, so I thought I'd try and give something back...<BR><BR>Real dynamic includes:<BR>I developed this technique while working on a legacy system and have never seen it done before, it has opened up a load of different applications. Here is the concept...<BR><BR>The page being executed is itself an object, hence it can reference itself using the "me" keyword. We store the current page reference in a session variable using "me". We then call a child page based on some criteria using server.execute. On the child page we use the session variable to reference ANYTHING that is on the parent page. As Gordon Ramsay would say... "dynamic includes, done."<BR><BR>Sample code:<BR><BR>Page1.asp -<BR><%<BR> dim strTest : strTest = "hello"<BR> response.write "Variable ""strTest"" on Page1= " & strTest & "<br />"<BR> set session("passThrough") = me<BR> server.execute("Page2.asp")<BR> response.write "We are back in Page1 and ""strTest"" is now= " & strTest & "<br />"<BR> set session("passThrough") = nothing<BR>%> <BR><BR>Page2.asp -<BR><%<BR> session("passThrough").strTest = "goodbye"<BR> response.write "We are in Page2 and have just modified Page1's ""strTest"" variable <br />"<BR>%><BR><BR>I hope you can see the possibilities.<BR><BR>Cheers,<BR><BR>Reiss ;op
is supposed to set the session variable to a reference to the current page. But that is *NOT* a thread-safe thing to do, even if it happened to work! Could have disastrous consequence on your site performance.
I would definitely ignore that post.
What you *can* do is simply pass DATA back and forth in session variable(s) and then remove the session variable(s) when you are done. You could even pass an array back and forth, so you are only using one session variable.