



(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 :
String Functions
Reading form variables passed in the URL
Recordset Access Methods
SQL Access Methods In ASP
ASP.NET Tutorial - Making image thumbnails
Creating Databases
Date and Time Functions In ASP
Server Variables In ASP
Installing ASP on your own computer
AIM Profile Screenname Viewer as a component of AIM Profile Designs
Displaying Server Values In ASP
Processing Form Information In ASP
Text Editors and Software to Write ASP
Counter in ASP
Searching for Matching Values
ASP.NET in Dreamweaver 8
Counting Visitors In ASP
GLOBAL.ASA IN ASP
Passing Query Strings In Asp
Iterating through Collections In ASP














