473,699 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?ev enttype=1&curmo nth=8&curyear=2 006"-->

any suggestions.

Thank You
Aug 11 '06 #1
3 9238
=?Utf-8?B?VG9kZA==?= wrote on 11 aug 2006 in
microsoft.publi c.inetserver.as p.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?ev enttype=1&curmo nth=8&curyear=2 006"-->
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.queryst ring("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
2990
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 that by accident they had been typing (over the querystring I guess), and the url had become default.asp?pageid='asd
3
4987
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. The first column 'Pnr' is a unique ID for each user that i made appear as a link. clicking on one userID should present a form where the picked users userdata is already filled in so i can easily edit it and then move on to submit the form to...
4
2734
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 system, and when I activate a user that has registered to my system, the current admin user logged in gets logged out. I can't seem to work out how - I can't even trace back where some of the variables are coming from (for example, the "ref" part of the Request.QueryString method). Could someone...
11
11971
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 like '%doe%' Passing a basic string works fine. But, when I use the LIKE statement it does not work. I know it's because of the % sign, so how do I translate this thru, so that the following page picks up the percent sign? *** Sent via Developersdex http://www.developersdex.com ***
8
1973
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 variables with in a header file. lets say int i; i then want to be able to acess that variable from multipul .cpp files where I can read it and also change the value. i would like to hold it in a struct or a class eventualy but i can't even get it to work on its own at min, so i thought id...
5
1907
by: Me | last post by:
I was wondering if after parsing Querystring, I could initialize it. Is it possible? Thank you, -Me
111
4635
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 like this in mind... int i; for(i = 1; i < 4; i++){
0
5015
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 System.Web.HttpContext class. 1) For accesing session variables : System.Web.HttpContext.Current.Session 2) For accesing Application variables : System.Web.HttpContext.Current.Application 3) For accesing QueryString variables : System.Web.HttpContext.Current.Request.QueryString Here is a simple example where...
4
1855
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 have started from a simple project (a login system with forms) due to projects platform (a mobile web site) i cant use cookies (cookies arent supported on all phones), anyway because of that i do un/pw check on very page and i have to put Dim MyUn As String =...
0
8687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8914
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6534
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.