, , ,


Querystring (also called an HTTP Querystring) is part of the set of characters automatically input in the address bar of a dynamic Web site when a user makes a request for information according to certain criteria.

I’ll be discussing now ways to pass values as Parameters in Querystring:

1> In my last post I passed only one parameter in my query string as:


I fetched the same using:

String PN = Request.QueryString[“PN”].ToString();


2> But, In case we have known Multiple values that are being passed in a sequence, we can use multiple parameters in Querystring :


The same can be fetched as:

String PN = Request.QueryString[“PN”].ToString();
String FN = Request.QueryString[“FN”].ToString();
String LN = Request.QueryString[“LN”].ToString();
String CT = Request.QueryString[“CT”].ToString();
String CTR = Request.QueryString[“CTR”].ToString();


3> And what if we have multiple values and donno the count??

For that we can use the same parameter with values as comma seperated:


The same can now be fetched as:

String[] strSample = Request.QueryString[“pid”].Split(‘,’);
int l = strSample.Length;

for (int i = 0; i <= strSample.Length; i++)
String PN = strSample[i];
// use the variable in your code accordingly
Hope that was helpful.
Thanks !!!