Hi Andy,
Its very simple...
If you want to pass data (value) from pageA to pageB on click of a button,
then on the click event of the button in pageA..
Response.Redirect("FULL_URL_OF_THE_PAGE?Value1=" + Value_you_want_to_send +
"&Value2=" + Value_you_want_to_send);
And in pageB page load event (in the if(!postback)) capture the query string
value like this...
string query = "select * from Products where ProductID='" +
Request.QueryString [ "Value1" ] + "'";
As Bryan explained, A NameValueCollection containing the collection of query
string variables will be sent to the next page.
NOTE: In this example i have given how to capture for 2 values in Query
string.
Need any help, do post a msg back..
Happy Coding.
"Andy" wrote:
I haven't done any web work for over a year and for the life of me I cannot
remember how to use a query string in a URL. I want the link to be
page.aspx?ID=1 then pass 1 into a query like this
select * from table where id = "query string value"
I know it's simple, I just haven't done it for a long time. Can somebody
please help me out? Thanks