pass an array in a QueryString

pageone.aspx

ArrayList arrParam = new ArrayList();
arrParam.Add(“1,2,3,3”);
arrParam.Add(“2,3,4”);
arrParam.Add(“56,7,6”);

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

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

pagetwo.aspx

string[] param = Request[“param”].ToString().Split(‘|’);
ArrayList arrparam = new ArrayList();
foreach (string str in arrparam)
{
arrparam.Add(str);
}

Advertisements
By Sriramjithendra Posted in ASP.NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s