Problem and Solutions



How to pass an array in a QueryString ?

I am developing a website in and C#, I need to pass array in QueryString.

Currently I am using Cookies for transferring array from one page to another page.

But problem is that when i open same page in multiple window with different parameter then old page result is replacing with current page.

So that i decided to use QueryString But problem is that i don't know is it supporting in QueryString.

Could someone help me to solve this problem
Posted by: Sam
On 17 Oct 2012 | Views: 4911 | Categories: C#, ASP.NET
 On 18 Oct 2012 12:09:50 PM
Passing array in QueryString


ArrayList arrParam = new ArrayList();

string strParam = String.Join("|", ((string[])arrParam.ToArray(typeof(String))));

Response.Redirect("pagetwo.aspx?param=" + strParam);


string[] param = Request["param"].ToString().Split('|');
ArrayList arrparam = new ArrayList();
foreach (string str in arrparam)
 On 09 Nov 2012 10:22:39 AM
Cant you use .net session handling to keep it simple
 On 09 Nov 2012 11:02:06 AM
Dear Vall

We can use session but session uses server memory, it causes performance issues when number of concurrent users will increase.

I think QueryString is the Best option, only thing is we need to pass it in encrypted format

 On 11 Nov 2012 05:18:18 AM
i was going to suggest session but it can cause performance issues as Michael explained above. But if this can be eradicated, this is the better solution.

the default maximum length for query string is 2048. this is configurable in .net 4.0.
i'll advise you take this into account.
you have to ensure that your array string's length doesn't exceed the permissable maximum length
 On 11 Nov 2012 10:59:37 AM
I agree with @Francis about the querystring size limit, you have to ensure that your array string's length doesn't exceed the permissable maximum length
Post your Solutions  


Other lins

.Net Techies
Other lins