You must Sign In to post a response.
  • Category: ASP.NET

    How to pass a array values in query string and retrive the values in next page

    How to pass a array values in query string and retrive the values in next page
  • #216604
    You can not pass arry to the query string. Instead you can pass the strings. So Extract the array values into string variable and pass it to the query string.

  • #216626
    protected void Button1_Click(object sender, EventArgs e)
    {
    int[] array=new int[5];
    //insert values in array
    for (int i = 0; i < array.Length; i++)
    {
    array[i]=i+1;
    }

    //creating redirect url
    string url = "default2.aspx?";
    string url1 = "";
    for (int i = 0; i < array.Length; i++)
    {
    url1 = url1 + "array" + i + "=" + array[i].ToString();
    if (i < array.Length - 1)
    url1 = url1 + "&";
    }
    //redirect to next page
    Response.Redirect(url + url1);
    }


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.