Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > querystring variables in #include files

Reply
Thread Tools

querystring variables in #include files

 
 
Todd
Guest
Posts: n/a
 
      08-11-2006
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
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      08-11-2006
=?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)
 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      08-11-2006
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.


 
Reply With Quote
 
Todd
Guest
Posts: n/a
 
      08-11-2006
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.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
How to get value of QueryString inside QueryString Mehdi ASP .Net 6 04-06-2006 03:41 PM
Passing QueryString URL as a paremeter in QueryString Adeel Ahmad ASP General 1 03-07-2006 02:05 PM
404's, aspxerrorpath, and querystring variables news.microsoft.com ASP .Net 1 07-21-2004 09:11 PM
PLEASE - Session Variables OR Response.Write querystring to target frame? KathyB ASP .Net 2 07-02-2003 12:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57