Showing QueryString values via the QueryString Collection in ASP.NET
<%@ Page Language="vb" %>
<html>
<head>
<title>Showing QueryString values via the QueryString Collection in ASP.NET</title>
</head>
<body>
<%
Dim Counter1, Counter2 As Integer
Dim Keys(), subKeys() As String
Dim MyQueryStringCollection As NameValueCollection
MyQueryStringCollection=Request.QueryString
Keys = MyQueryStringCollection.AllKeys
For Counter1 = 0 To Keys.GetUpperBound(0)
Response.Write("Key: " & Keys(Counter1) & "<br>")
subKeys = MyQueryStringCollection.GetValues(Counter1) ' Get all values under this key.
For Counter2 = 0 To subKeys.GetUpperBound(0)
Response.Write("Value " & CStr(Counter2) & ": " & subKeys(Counter2) & "<br>")
Next Counter2
Next Counter1
%>
</body>
</html>
Related examples in the same category