Hi all,
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...
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.
Sample code:
VBSCRIPT version
Page1.asp -
<%
dim strTest : strTest = "hello"
response.write "Variable ""strTest"" on Page1= " & strTest & "<br />"
set session("passThrough") = me
server.execute("Page2.asp")
response.write "We are back in Page1 and ""strTest"" is now= " & strTest &
"<br />"
set session("passThrough") = nothing
%>
Page2.asp -
<%
session("passThrough").strTest = "goodbye"
response.write "We are in Page2 and have just modified Page1's ""strTest""
variable <br />"
%>
JSCRIPT version
Page1.asp -
<%
var strTest = "hello";
Response.write('Variable "strTest" on Page1= ' + strTest + '<br />');
Session("passThrough") = this;
Server.Execute("Page2.asp");
Response.write('We are back in Page1 and "strTest" is now= ' + strTest +
'<br />');
Session.Abandon();
%>
Page2.asp -
<%
Session("passThrough").strTest = "goodbye";
Response.write('We are in Page2 and have just modified Page1\'s "strTest"
variable <br />');
%>
My question is, will this cause any threading issues in either vbscript or
jscript? I don't think it will as it's a reference that is being stored in
the session rather than the object itself. Hopefully somebody can confirm
this for me.
Thanks for any help,
Reiss


