Hi,
I have an ASP.NET website in which I have to perform a certain operation. I have to displaying the ID's from the DB on
menu.aspx
page in this format
{1:2:3:4}
. The above format is not a problem and can be just be written with
Response.Write("{");
for.. loop(until last ID)
{
Response.Write(query to fetch ID's) + ":";
}
Response.Write("}");
But here comes my question. I have to generate this ID when the user types the query within the URL somewhat like
http://localhost/website/menu.aspx?search=yes
Note that I am saying that
the user will type this URL. I know that query string can pass the values from one form to another but this is a single web form and if I attach this
?search=yes
, it should return the result. How can this be done?
Something similar to searching in Google. For eg: I can type
www.google.com/search?CP
and I get the results
Edit
--
I am using this small code snippet for the query string
if (Request.QueryString["search"] != null) {
Response.Write("{");
for.. loop(until last ID) {
Response.Write(query to fetch ID's) + ":";
}
Response.Write("}");
}
I have to change some things so that on this query string
localhost/website/?search=codeproject
, the codeproject should be appended to my output i.e
codeproject{1:2:3:4)
. Similarly for all other values searched through query string should be appended to the output. How to do this?