Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   SSI/ASP PROBLEM (Query String) HELP!!! (http://www.velocityreviews.com/forums/t792111-ssi-asp-problem-query-string-help.html)

Jeremy 12-11-2003 01:40 PM

SSI/ASP PROBLEM (Query String) HELP!!!
 
I'm posting my message again since I've received 0 replies the first time.


In IIS5 with ASP when I try to run an SSI command:

<!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->

I get "404 Object Not Found" But if I remove the query string like so:

<!--#include virtual="/asp_scripts/template.asp" -->

It works just fine.

Any ideas on how to fix this problem? Time is of the essence and I
really appreciate your time and responses.

Thanks,
Jeremy

Tim Slattery 12-11-2003 02:01 PM

Re: SSI/ASP PROBLEM (Query String) HELP!!!
 
jcapp@belzon.com (Jeremy) wrote:

>I'm posting my message again since I've received 0 replies the first time.
>
>
>In IIS5 with ASP when I try to run an SSI command:
>
><!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->
>
>I get "404 Object Not Found" But if I remove the query string like so:


I'm a bit surprised at the message, but not at the fact that this
doesn't work. The "include" directive just reads another file and
plunks it into the file currently being worked on. It does not make a
web request, which is what you are trying to do here. This simply will
not work.

--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov

Bob Barrows 12-11-2003 02:02 PM

Re: SSI/ASP PROBLEM (Query String) HELP!!!
 
Jeremy wrote:
> I'm posting my message again since I've received 0 replies the first
> time.
>
>
> In IIS5 with ASP when I try to run an SSI command:
>
> <!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main"
> -->
>
> I get "404 Object Not Found" But if I remove the query string like so:
>
> <!--#include virtual="/asp_scripts/template.asp" -->
>
> It works just fine.


This is expected. Code in an Included page has access to the querystring of
the page in which it is Included. If the required values are not part of the
request collection of that page, then you need to use global variables in
that page which are referenced in the code in the Included page:

<%
dim strsection, strsub
strsection=1
strsub="Main"
%>

In template.asp, instead of using
request.querystring("section")

use

strsection

HTH,
Bob Barrows



--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Jeremy Capp 12-11-2003 02:20 PM

Re: SSI/ASP PROBLEM (Query String) HELP!!!
 
Thanks, Bob, for the reply. I guess I'm just going to have to change all
my .shtml files to .asp files so I can create these variables.

It sucks that ASP/IIS doesn't allow this.....putting query strings that
include CGI/Perl scripts via SSI works just fine.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jeremy Capp 12-11-2003 02:20 PM

Re: SSI/ASP PROBLEM (Query String) HELP!!!
 
Tim,

I appreciate the reply. However, I've been programming in Perl for
many years and putting a query string into an include ALWAYS worked. I
guess ASP just sucks and I'll have to change all my .shtml files to .asp
files so I can create the variables to pass to the script I'm trying to
call.

Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tim Slattery 12-11-2003 05:37 PM

Re: SSI/ASP PROBLEM (Query String) HELP!!!
 
Jeremy Capp <jcapp@belzon.com> wrote:

>Tim,
>
> I appreciate the reply. However, I've been programming in Perl for
>many years and putting a query string into an include ALWAYS worked. I
>guess ASP just sucks and I'll have to change all my .shtml files to .asp
>files so I can create the variables to pass to the script I'm trying to
>call.


The SSI facility in ASP is *not* the same as anything in Perl, I'm
certain of that!

I know Perl, but I don't know of an "include" facility in that
language. I assume that you actually were submitting a web request and
catching the result in your Perl code. As you now know, ASP's
"include" doesn't work like that.

--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov


All times are GMT. The time now is 05:16 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.