



(2 ratings)
This page describes how to get the value of URL parameters such as ?id=5432 that have been passed to your webpage in the URL, usually by a form that has been submitted. Maybe the URL requested was:
http://www.mywebsite.com/MyWebPage.aspx?id=5432&size=large
What we are trying to do is to get the value of id and size, extracted out of the URL and into our application.
In fact this is very simple to do. In C# use this:
string id=Request["id"];
and in VB.net, use this:
dim id as string = Request("id")
This gets the value of the parameter named "id" from the URL. The best thing to do is to use this code in your Page_Load event handler to get the value from the variables passed to your web page.
NOTE: You can also use the slightly more verbose:
Request.QueryString("id")
which does exactly the same thing but takes longer to type!
NOTE 2: If the parameter cannot be found in the url then the method returns null.20 Random Tutorials from the same category :
The Recordset Object
Recordset Access Methods
SQL Access Methods In ASP
Processing Form Information In ASP
GLOBAL.ASA IN ASP
Using Application Variables
Displaying Server Values In ASP
Server-side Scripting
Counting Visitors In ASP
DISPLAY DATA FROM DATABASE
Counter in ASP
ASP Components
FORMAT SPECIAL DATA
Searching for Matching Values
ASP.NET Tutorial - Making image thumbnails
Server Variables In ASP
The Connection Object
Date and Time Functions In ASP
String Functions
Reading form variables passed in the URL













