473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing Parameters to Server.Execute or #Include ?

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
5 11081
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

"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
> 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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aaron | last post by:
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated parameters. The whole report just comes up blank with...
3
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table....
3
by: Hursh | last post by:
Hi, I have written some stored procedures in SQL and these procedures return some value. I want these values to be captured by the ASP code. I am able to access the tables using ADO(...
7
by: TNGgroup | last post by:
Hi, I have some troubles with the correct syntax, hope to get some help. This is the intention: This is the code I'd like to use. url: http://webserver/ta.asp?artnr=04001 Code ta.asp:...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.