Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Real Dynamic Includes - Threading Issue

Reply
 
Old 12-30-2008   #1 (permalink)
atwork8


 
 

Real Dynamic Includes - Threading Issue

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


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
In What Order Should I Install These Updates (includes IE8 & SP2) Windows Updates
.NET Includes Question .NET General
What version includes IIS Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46