472,353 Members | 1,020 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

querystring variables in #include files

Hello...I'm trying to include querystring variables in a #include but it's
not working

this works:

<!--#include file="calendar/calendar.asp-->

this does not:

<!--#include
file="calendar/calendar.asp?eventtype=1&curmonth=8&curyear=2006"-->

any suggestions.

Thank You
Aug 11 '06 #1
3 9044
=?Utf-8?B?VG9kZA==?= wrote on 11 aug 2006 in
microsoft.public.inetserver.asp.general:
Hello...I'm trying to include querystring variables in a #include but
it's not working

this works:

<!--#include file="calendar/calendar.asp-->

this does not:

<!--#include
file="calendar/calendar.asp?eventtype=1&curmonth=8&curyear=2006"-->
The second would have no sense, since the <!--#include only inserts the
litteral content of the file, whatever it's extension[!!!], in the calling
file, and does not execute by itself.

This litteral content can be asp code or any other and is,
if it is asp code only executed as part of the "include calling" page.

Why do we often stress include called pages should have a .asp extension?

Because with another extension, say: .txt, .inc, .html, if the page were
accessable from the internet, it's content could be read by anyone.

So request.querystring("eventtype") will only return what is in the main
..asp page, even if this [part of code is in the included file.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 11 '06 #2
Todd wrote:
Hello...I'm trying to include querystring variables in a
#include but it's not working
Patient: Doctor, it hurts when I do this
Doctor: Then don't do that

Seriously, there is no way to do what you suggest. The included file is
treated like a script fragment and shares form & querystring information
with the enclosing document. In fact, the entire document is parsed as one
document ONLY AFTER all of the include files are assembled.
http://msdn.microsoft.com/library/en...6dc027a608.asp

I suspect from your example that you might get what you want from
Server.Execute()
http://msdn.microsoft.com/library/en...ef530de23f.asp

--
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.
Aug 11 '06 #3
Thank you...yes..I forgot about how it works

"Dave Anderson" wrote:
Todd wrote:
Hello...I'm trying to include querystring variables in a
#include but it's not working

Patient: Doctor, it hurts when I do this
Doctor: Then don't do that

Seriously, there is no way to do what you suggest. The included file is
treated like a script fragment and shares form & querystring information
with the enclosing document. In fact, the entire document is parsed as one
document ONLY AFTER all of the include files are assembled.
http://msdn.microsoft.com/library/en...6dc027a608.asp

I suspect from your example that you might get what you want from
Server.Execute()
http://msdn.microsoft.com/library/en...ef530de23f.asp

--
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.
Aug 11 '06 #4

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

Similar topics

7
by: Robb Meade | last post by:
Hi all, A recent project that I had finished and went live with no apparant problems. My client received an email from a user who mentioned...
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"...
4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management...
11
by: Joey Martin | last post by:
I am passing a sql string thru my querystring for the next page to capture. example: www.xxxxxxxx.com/index.asp?str=select * from table where name...
8
by: scott | last post by:
hi, sorry if this has been adressed some where elss. if it has plz can you point me to it and ill go read it. any way, i want to declare some...
5
by: Me | last post by:
I was wondering if after parsing Querystring, I could initialize it. Is it possible? Thank you, -Me
111
by: Nate | last post by:
Hello, I am looking for a method to automatically declare variables in C. I'm not sure if there is a good way to do this, but I had something...
0
by: bharathreddy | last post by:
Here I will given an example on how to access the session, application and querystring variables in an .cs class file. Using...
4
by: .nLL | last post by:
Hi, im am a classic asp developer and started to learn asp.net but got stuck with a simple problem even before i step in to further. to learn i...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.