Tuesday, February 9, 2010

Query Strings

Query strings are name value pairs that send data from one page to another and is attached to the URL. When coding query strings remember that each pair starts with an ampersand.

In order to send data over we must use the Redirect method.
Response.Redirect("page1.aspx?Name=" & txtName.Text)

The ? starts the query and separates it from the URL.

To call the information on the page its being sent to, the code below will help:
Request.QueryString("Name")

No comments:

Post a Comment