Server.Execute

E

Elie Grouchko

Hi

I am calling Server.Execute("2.asp") from "1.asp" and expect to have
application variables declared in "1.asp" available to the script code in
"2.asp", at least this is what the documentations says, but it doesn't work.
I am declaring the variables in "1.asp" as public (VBScript). Does anyone
have an idea if this is supposed to work?

Many thanks

Elie Grouchko
 
S

Steven Burn

Example:

Form1.asp

<input type=text name=myvar value=<%myvariable%>>

Form2.asp

myvar = Request.Form("myvariable")

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
Y

Yan-Hong Huang[MSFT]

Hello Elie,

Thanks for posting in the group.

Based on my understanding, now the question is: You use Server.Execute to
execute another asp file (2.asp) in 1.asp. However, one variable is not
accessable in 2.asp. Please correct me if I have misunderstood the probelm.

When we use the Server.Transfer and Server.Execute methods, the ASP
intrinsic objects are transferred and maintained. This includes Request,
Response, Server, Session, and Application. However, if you define a
variable in 1.asp, it won't be visible in 2.asp.

Steven has introduced a good method. You could persist value in Request
object. Also, you could store the value in session so that it could be
accessable in 2.asp.

Does that answer your question? If there is any unclear on it, please feel
free to post in the group.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Brynn

You can not declare a variable in one page, and use it in a page you
are executing ... think of the page being executed as it's own little
world ... the only thing it has available to it is .QueryString .Form
..Cookies .Sessions ... but no variables.

I also want to add that creating a Cookie or session in 1.asp is not
always reliable in passing data to 2.asp

Brynn
www.coolpier.com



Hi

I am calling Server.Execute("2.asp") from "1.asp" and expect to have
application variables declared in "1.asp" available to the script code in
"2.asp", at least this is what the documentations says, but it doesn't work.
I am declaring the variables in "1.asp" as public (VBScript). Does anyone
have an idea if this is supposed to work?

Many thanks

Elie Grouchko

I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

Brynn
www.coolpier.com
 
E

Elie Grouchko

Thanks

Brynn said:
You can not declare a variable in one page, and use it in a page you
are executing ... think of the page being executed as it's own little
world ... the only thing it has available to it is .QueryString .Form
.Cookies .Sessions ... but no variables.

I also want to add that creating a Cookie or session in 1.asp is not
always reliable in passing data to 2.asp

Brynn
www.coolpier.com





I participate in the group to help give examples of code. I do not
guarantee the effects of any code posted. Test all code before use!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top