|
Retrieving QueryString Data
QueryString collection is a way of passing data between the client and
server. QueryStringdata is passed in the URL along with the request.
QueryString data is easy to use--- even easier than cookies --- so it's
extremely convenient when you need to send a few data values to the
server. Another advantage is that you can embed QueryString values in
HTML.
<%@ Language=VBScript %>
<% option explicit %>
<html>
<head></head>
<body>
<h2>Values Appear Here</h2>
<%
dim V
if Request.QueryString("ShowQueryString") = "True" then
for each V in Request.QueryString
Response.Write V & "=" & Request.QueryString(V) & "<br>"
next
end if
%>
<hr>
<h2>Click on one of the links</h2>
<a href="tt1.asp?ShowQueryString=True&FirstName=Tej&LastName=Master'>
Tej Master
</a>
<br>
<a href="tt1.asp?ShowQueryString=True&Employees=5&1=Bob+Frankli&2= George+Lukas&3=Sarah+M+Myers&4=Jocelyn+Templeton&5=Brenda+Lewis"> Show Employees
</a><br>
<a href="tt1.asp?ShowQueryString=False&Values=0"> This link won't show any values
</a>
</body>
</html>
|