[mapserver-users] ASP as template file

Brent Fraser bfraser at geoanalytic.com
Wed Jun 5 12:18:42 PDT 2002


Chris, Ed, and others...

  We did a little project with standard CGI (no ASP front-end) MapServer 3.5
using ASP (under IIS 4)to return query results.  Our query template looked
like:

IMapPro.html:
===============================================
<HTML>
<HEAD>
</head>
<BODY><CENTER>
<script language="javascript">
(window.location="/test/imappro1.asp?strtile=[TILEID]&intutm=[UTMZONE]&strim
gdate=[IMAGEDATES]")
</script>
</HTML>
===============================================
(Note that the JavaScript causes the results to be displayed in a
new/separate window than the one the map interface is in.)

  The ASP code (VBScript in our case) gets the values of the variables that
were substituted as part of Mapserver processing the template:

imappro1.asp:
===============================================
<HTML>
<HEAD>
</head>
<BODY>
<%
strtile = request.QueryString ("strtile")
strimgdate=request.QueryString ("strimgdate")
intutm=request.QueryString ("intutm")

strlevel1=mid(strtile,1,5)
strlevel2=mid(strtile,1, 6)
strlevel3=mid(strtile,3, 6)
%>

<H1><b>Image Maps PRO</b></H1>

<table cellpadding=5 cellspacing=2 border=1>
<tr><th> Product Status </th><th> Tile ID </th><th> Image Dates </th></tr>
<tr><td> AVAILABLE </td><td> <%=strtile%> </td><td> <%=strimgdate%>
</td></tr>
</TABLE>
</HTML>
===============================================

I'm not sure the re-direction is strictly necessary.  I seem to recall
MapServer having a problem with templates having an extension of ASP (and
indicating to IIS to treat it as ASP), and IIS having a problem with ASP
files with an extension of HTML.

Nothing like a little re-direction to solve a web problem....

Brent Fraser
GeoAnalytic Inc.
bfraser at geoanalytic.com

----- Original Message -----
From: "Ed McNierney" <ed at topozone.com>
To: "Christian Runge" <crg at carlbro.dk>; <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, June 05, 2002 8:51 AM
Subject: RE: [mapserver-users] ASP as template file


> Christian -
>
> What you're doing wrong is trying to use ASP like this - it simply won't
work.  Your client browser makes an HTTP request to the MapServer CGI
program, which processes the MAP file, the TEMPLATE file, and the CGI
parameters to generate an output stream that's sent to the client in
response to that HTTP request.  Alternatively, your client browser could
make an HTTP request to the ASP parser program, which processes an ASP file
and generates an output stream that's sent to the client in response to that
HTTP request.  But a given HTTP request can't do both.
>
> Depending on your circumstances, you might be better off using fewer of
the MapServer template features and replacing them with ASP functionality
instead.  I wrote a wordy note to the list a little while ago about using
ASP with MapServer - you can find it in the archives at:
>
> http://mapserver.gis.umn.edu/wilma/mapserver-users/0110/msg00296.html
>
> - Ed
>
> Ed McNierney
> Chief Mapmaker
> TopoZone.com
> ed at topozone.com
> (978) 251-4242
>
>
> -----Original Message-----
> From: Christian Runge [mailto:crg at carlbro.dk]
> Sent: Wednesday, June 05, 2002 9:26 AM
> To: 'mapserver-users at lists.gis.umn.edu'
> Subject: [mapserver-users] ASP as template file
>
>
> Hello everyone.
>
> I'm working with a map where I need to do some queries. I would like the
> result of those queries to be handles by an active server page insted of a
> simple html file. The following worked fine in version 3.4:
>
> QUERY
> TEMPLATE 'processquery.asp'
> END
>
> Now I'm trying to do the same in version 3.5 and I believe this should be
> correct syntax:
>
> LAYER
> ....(omitted)...
> CLASS
>     SIZE 1
>     TEMPLATE 'processquery.asp'
> END #Class
> END #Layer
>
> For some reason the asp is not parsed by the asp parser and the entire
> content is sent to the client browser (which ignores it of course). What
do
> I do wrong?
>
> Thanks in advance
> Christian Runge
>
> P.S. I use the following system when running it:
> Windows 2000 server
> Internet Information Server
> Mapserver 3.5
> Internet Explorer 5.5 as test client




More information about the MapServer-users mailing list