I have a parameter in my url, for example
page.aspx?param1=100
I would like to take the value of the param1 parameter, and store it into a variable. only i'm not sure how.
how can i get access to the url string in my vb code of my aspx page?
THANKS!
Printable View
I have a parameter in my url, for example
page.aspx?param1=100
I would like to take the value of the param1 parameter, and store it into a variable. only i'm not sure how.
how can i get access to the url string in my vb code of my aspx page?
THANKS!
VB.NET:
Dim myString as String = Request.QueryString("param1")
Dim myInt as Integer = Integer.Parse(myString)
C#:
string myString = Request.QueryString["param1"];
int myInt = int.Parse(myString);
Those may not be exact syntax, but it will be pretty close.
GREAT!
That worked perfectly.
Thanks again !!
No problem, be sure to do error checking. If the value doesn't exist, an empty string is returned. If you call integer.parse() on a empty string an error will be thrown.