It comes from the Request.QueryString collection. I forget the VB code, but
in C# it's:
Request.QueryString["myParam"].ToString()
Keep in mind, before you ever attempt to reference it, you'll need to make
sure that it is not a null value. If you don't test for null first, and the
querystring variable isn't present (it could be there but misspelled for
example) then it will through a null reference error when you attempt to use
the ToString() method on it. Always test for null first just in case.
in C# the test woud be:
if(Request.QueryString["myParam"] != null)
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Tor Inge Rislaa" <to************@rislaa.nowrote in message
news:uB**************@TK2MSFTNGP06.phx.gbl...
Passing and using parameters
How to get hold of the parameter value provided by the URL? When I open a
web form with a DataSource I often include a parameter in the URL as
below:
myNewPage.aspx?myParam = 10
If I simply need to use the value of myParam in the VB code when the new
page load, how do I refer to the parameter?
e.g. myLabel.Text = myParam (where myParam is replaced with a proper way
to refer to it)
TIRislaa