retrieving values in array & store in session and calling to other page asp.net c#
<p>Hi
I want to store values inside the array in session. I want to use it to another page. How i can do that?
I used session to store values of array as follow:</p>

<pre><code>    int i, randno;
    int[] a = new int[5];
        for ( i = 0; i &lt; 4; i++)
        {
            int flag = 0;
            Random rnd = new Random();
            randno = rnd.Next(1, 15);
            for (int j = 0; j &lt; i; j++)
            {
                if (a[j] == randno)
                    flag = 1;
            }
            if (flag == 0)
            {
                a[i] = randno;

            }
            else
            {
                i--;
            }

        }
Session["values"] = a;
</code></pre>

<p>In other page i used code: </p>

<pre><code>int[] a = (int[])Session["values"];
Response.Write(a);
</code></pre>

<p>This code is right? 
Because its not giving values.
But retrieving to another page then it gives last value of the array, on the same page it gives all the values. I want all the values of the array.
Asp.net, c#
Thank you. </p>
