Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Post static info to ASP in URL

0 views
Skip to first unread message

Florus Hoogendoorn

unread,
Jan 29, 2001, 4:32:00 AM1/29/01
to
Maybe can somebody tell me if it's possible to send static information to an
ASP-page. I tell you what I'm trying to do.
I'm developed a Visual Basic application and I want to update some
information from a website with asp-scripts. If I'm visit the website I must
first answer some questions before I receive the page with information I
need. The answers are always the same so I was thinking if it is possible to
send these answers in the URL so I receive at once the page I need.
Is it possible ? And if Yes, How?

Thank you,
Florus Hoogendoorn


G. Andrew Duthie

unread,
Jan 29, 2001, 8:31:48 AM1/29/01
to
It's not clear whether you are asking about ASP or ASP.NET, but in either
case the answer is yes. You can write the target page in such a way as ot
allow the user (or a hyperlink that you create from another page) to provide
parameters to the target page on the QueryString. The QueryString is
everything that follows a ? in the URL, in the following format:
http://myURL/myPage.aspx?param1=value1&param2=value2 (etc.). Note that all
parameters must follow the rules of URL encoding (any chracters not allowed
in URLs must be encoded, such as substituting %20 for spaces within values
in the querystring).

Once having passed the parameters and values in on the querystring, you can
retrieve them using the QueryString collection of the Request object (which
provides access to information specific to the request, such as querystring
values, form fields, etc.). Here's some sample code that works in either ASP
or ASP.NET:

<%@ Language=VBScript %>

<html>
<head>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
</head>
<body>

<%
Response.Write ("Param1 = " & Request.QueryString("Param1"))
%>

</body>
</html>

Note that for ASP.NET the first line would look more like the following:

<%@ Page Language="vb" AutoEventWireup="false" %>

HTH,
--
G. /\ndrew Duthie
-------------------------------
PLEASE POST ALL FOLLOW-UPS TO THE NG
-------------------------------
"Man will occasionally stumble over the truth, but most times he will pick
himself up and carry on."
Winston Churchill
-------------------------------


"Florus Hoogendoorn" <f.p.hoo...@philips.com> wrote in message
news:953do9$jsm$1...@porthos.nl.uu.net...

0 new messages