ASP   «Prev  Next»

Request.QueryString - Exercise

Use ASP to pass a query string

Objective:Use ASP to pass input data in a query string.
This exercise is an opportunity for you to check your understanding of the material covered in the preceding lesson.
When you are finished, click the Submit button to view the suggested results.


This lesson illustrated the use of the ASP Request object to read and reference one or more pieces of user data submitted in an HTML Form command using the GET method. This exercise will give you the opportunity to create a short ASP script that will do this and then pass the data in a query string as part of a URL.


Write an ASP script named querystring.asp that will reference and write the contents of the textbox (txtName) submitted through HTML Form command in the getform.html file.


The HTML file, getform.html, needed for this exercise is a part of the download file located on the course Resources page.


  1. The HTML page supplied uses the GET method to submit the form for processing. The action field in the FORM command is not filled in. You will need to insert the name of the ASP file into this field.
  2. As in the lesson example, you will be using the QueryString collection of the Request object to retrieve and reference the data in the textbox field.