By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,827 Members | 813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,827 IT Pros & Developers. It's quick & easy.

Passing Parameters to Server.Execute or #Include ?

P: n/a
I need to pass a static parameter to an included ASP file. I'm thinking
about using this with a query string, but upon reflection I'm not sure how I
can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it performing a
query on FIRST.ASP then? How can I retrieve the parameter?

Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Bill wrote:
I need to pass a static parameter to an included ASP file. I'm
thinking about using this with a query string, but upon reflection
I'm not sure how I can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it
performing a query on FIRST.ASP then? How can I retrieve the
parameter?


Yes. Try it. You'll see.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 21 '05 #2

P: n/a

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
Bill wrote:
I need to pass a static parameter to an included ASP file. I'm
thinking about using this with a query string, but upon reflection
I'm not sure how I can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it
performing a query on FIRST.ASP then? How can I retrieve the
parameter?


Yes. Try it. You'll see.


I did. Didn't work. I'm hoping someone smarter than you knows the answer.

Bill.

Jul 22 '05 #3

P: n/a
> I did. Didn't work. I'm hoping someone smarter than you knows the answer.

Nice.

Good luck, Bill, in getting any further assistance. I'd venture to say you
are on your own now.

Bob Lehmann

"Bill" <no*****@fooemail.com> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
Bill wrote:
I need to pass a static parameter to an included ASP file. I'm
thinking about using this with a query string, but upon reflection
I'm not sure how I can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it
performing a query on FIRST.ASP then? How can I retrieve the
parameter?


Yes. Try it. You'll see.


I did. Didn't work. I'm hoping someone smarter than you knows the answer.

Bill.

Jul 22 '05 #4

P: n/a
Bill wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
Bill wrote:
I need to pass a static parameter to an included ASP file. I'm
thinking about using this with a query string, but upon reflection
I'm not sure how I can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it
performing a query on FIRST.ASP then? How can I retrieve the
parameter?


Yes. Try it. You'll see.


I did. Didn't work. I'm hoping someone smarter than you knows the
answer.

Bill.


Silly. I was answering "yes" to your first question: "is it performing a
query on FIRST.ASP then?". I don't tend to answer "yes" to a question that
begins with "How".

Speaking of smarts, if you know enough to put "?a=2" into your #include
statement, why aren't you smart enough to simply put

dim a
a=2

into FIRST.asp? Then simply reference the a variable in second.asp (this
won't work with server.execute, but should work fine with a #include)
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #5

P: n/a

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Od**************@TK2MSFTNGP15.phx.gbl...
Bill wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
Bill wrote:
I need to pass a static parameter to an included ASP file. I'm
thinking about using this with a query string, but upon reflection
I'm not sure how I can do this. For example:

---file start: FIRST.ASP ------
<%
Server.Execute("second.asp?a=1")
%>

<!--- ***** or ***** --->

<!-- #include file="second.asp?a=2" -->

-----file end: FIRST.ASP --------------

Now, if I do a Request.QueryString("a") in second.asp, is it
performing a query on FIRST.ASP then? How can I retrieve the
parameter?

Yes. Try it. You'll see.
I did. Didn't work. I'm hoping someone smarter than you knows the
answer.

Bill.


Silly. I was answering "yes" to your first question: "is it performing a
query on FIRST.ASP then?". I don't tend to answer "yes" to a question

that begins with "How".

Speaking of smarts, if you know enough to put "?a=2" into your #include
statement, why aren't you smart enough to simply put

dim a
a=2

into FIRST.asp? Then simply reference the a variable in second.asp (this
won't work with server.execute, but should work fine with a #include)


This did exactly what I want. Thanks, Bob.


Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.