473,414 Members | 1,643 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,414 software developers and data experts.

Pass Parameters to <!-- #Include File="file.asp" -->

What is the workaround of passign a parameter to any included asp
file:

<!-- #Include File="file.asp" -->

This obviously does not work:

<!-- #Include File="file.asp?id=123" -->

Thank you

Apr 3 '07 #1
10 25323
Server.Execute Method

The Execute method calls an .asp file, and processes it as if it were part of the calling ASP script. The Execute method is similar
to a procedure call in many programming languages.

http://msdn2.microsoft.com/en-us/library/ms525849.aspx

<vu******@gmail.comwrote in message news:11**********************@n76g2000hsh.googlegr oups.com...
What is the workaround of passign a parameter to any included asp
file:

<!-- #Include File="file.asp" -->

This obviously does not work:

<!-- #Include File="file.asp?id=123" -->

Thank you

Apr 3 '07 #2
On Apr 3, 12:45 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
dot comwrote:
Server.Execute Method

The Execute method calls an .asp file, and processes it as if it were part of the calling ASP script. The Execute method is similar
to a procedure call in many programming languages.

http://msdn2.microsoft.com/en-us/library/ms525849.aspx

<vunet...@gmail.comwrote in messagenews:11**********************@n76g2000hsh.g ooglegroups.com...
What is the workaround of passign a parameter to any included asp
file:
<!-- #Include File="file.asp" -->
This obviously does not work:
<!-- #Include File="file.asp?id=123" -->
Thank you
so will this work?: Server.Execute myfile.asp?id=123

Apr 3 '07 #3
no, you don't need to pass anything through.

The external file is processes information as though it is part of the originating file.

Therefore any values in the originating file (id=123) can be used by the external file.
Apr 3 '07 #4
On Apr 3, 1:22 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
no, you don't need to pass anything through.

The external file is processes information as though it is part of the originating file.

Therefore any values in the originating file (id=123) can be used by the external file.
Do you say I cannot use params at all?

Apr 3 '07 #5
params aren't required with this solution, please read the instructions for usage at the site link provided.

<vu******@gmail.comwrote in message news:11**********************@b75g2000hsg.googlegr oups.com...
On Apr 3, 1:22 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
>no, you don't need to pass anything through.

The external file is processes information as though it is part of the originating file.

Therefore any values in the originating file (id=123) can be used by the external file.

Do you say I cannot use params at all?

Apr 3 '07 #6

<vu******@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
What is the workaround of passign a parameter to any included asp
file:

<!-- #Include File="file.asp" -->

This obviously does not work:

<!-- #Include File="file.asp?id=123" -->

Thank you
Is the file being included expecting to be able to read parameters from the
querystring?
Can it be independantly visited by the client or is it always intended to be
an include?
Apr 3 '07 #7
On Apr 3, 4:15 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
<vunet...@gmail.comwrote in message

news:11**********************@n76g2000hsh.googlegr oups.com...
What is the workaround of passign a parameter to any included asp
file:
<!-- #Include File="file.asp" -->
This obviously does not work:
<!-- #Include File="file.asp?id=123" -->
Thank you

Is the file being included expecting to be able to read parameters from the
querystring?
Can it be independantly visited by the client or is it always intended to be
an include?
i've decided using this strategy:
dim id : id=123
<!-- #Include File="file.asp" -->
id=321
<!-- #Include File="file.asp" -->

where file.asp will assign id value to appropriate object.
yes, i do need to use some kind of include method

Apr 3 '07 #8
vu******@gmail.com wrote:
i've decided using this strategy:
dim id : id=123
<!-- #Include File="file.asp" -->
id=321
<!-- #Include File="file.asp" -->

where file.asp will assign id value to appropriate object.
yes, i do need to use some kind of include method
This is an especially inefficient way to use include files. You would be
better served by putting the applicable parts of the include into a Sub or
Function, then call them with the respective IDs:

[------- Begin file.asp ----------]
Sub DoStuff(id)
{ your included code goes here }
End Sub
[-------- End file.asp -----------]

As long as everything in the include is in functions or subroutines, you can
place it anywhere in your document and make the calls where you need them.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Apr 3 '07 #9
On Apr 3, 6:06 pm, "Dave Anderson" <NYRUMTPEL...@spammotel.comwrote:
vunet...@gmail.com wrote:
i've decided using this strategy:
dim id : id=123
<!-- #Include File="file.asp" -->
id=321
<!-- #Include File="file.asp" -->
where file.asp will assign id value to appropriate object.
yes, i do need to use some kind of include method

This is an especially inefficient way to use include files. You would be
better served by putting the applicable parts of the include into a Sub or
Function, then call them with the respective IDs:

[------- Begin file.asp ----------]
Sub DoStuff(id)
{ your included code goes here }
End Sub
[-------- End file.asp -----------]

As long as everything in the include is in functions or subroutines, you can
place it anywhere in your document and make the calls where you need them.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
so if I have 4 pages I normally "include" now, you suggest to combine
them into one page each within a sub? that will be a loooong code
page. what is "inefficient" about my method above? i understand that
may not be the best way, but i want to know how it make things worse.

Apr 4 '07 #10
vu******@gmail.com wrote:
so if I have 4 pages I normally "include" now, you suggest to
combine them into one page each within a sub?
Not at all. I am saying there is almost never a benefit to including the
same file twice in the same script. To extend my example to your original
one, instead of this...

dim id : id=123
<!-- #Include File="file.asp" -->
id=321
<!-- #Include File="file.asp" -->

....use this:

<!-- #Include File="file.asp" --(with Sub defined)
DoStuff 123
DoStuff 321

what is "inefficient" about my method above? i understand that
may not be the best way, but i want to know how it make things
worse.
The parser will fetch a copy of the included file for each #include
statement and splice it into the script before parsing a sigle line of
VBScript. Your approach could add a tremendous amount of redundancy.

As for your concerns about the length of code, my suggestion actually
shortens it.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Apr 4 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scott Townsend | last post by:
I'd like to pass parameters to a local Application from a webpage. something like: <a href="file:///C:/Program%20Files/myapp/myapp.exe%20-custno:mycustno%20-quote no:12345%20-item:12345">test...
13
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. ...
5
by: Ben | last post by:
Hi I am using a User Control which is referenced by an ASPX page. How can I pass a string parameter to the user control, from the base ASPX page. Thanks Ben
6
by: Woody Splawn | last post by:
I am using SQL Server 2000 as a back-end to a VS.net Client/Server app. In a certain report I use a view as part of the query spec. For the view, at present, I am querying for all the records in...
3
by: Wang Xiaoning | last post by:
I have an customerdetail.xsl sheet ---------------------------------------------------------- <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0"...
3
by: Joseph Lu | last post by:
Hi, all I have a stored procedure created in SQL Server like the following lines. // stored proceudre code starts here CREATE PROCEDURE sp_insertdata @strdata varchar(250) , @rsult BIT...
0
by: raghuraman_ace | last post by:
Hi i have started a webservice wich has a webmethod with parameters using literal encoding & encoded encoding . The webservice is compiled successfully . But i don know how to pass the...
1
by: Hexman | last post by:
Hello All, I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file. My question is: How do I pass...
0
by: PriyaManasarovar | last post by:
Can someone help how to pass parameters to a crystal report using a Crystal report object? I am using a console application & hence crystal report viewer cannot be used. And i need to pass the...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.