title: Writing a passed Array via session into Label isn't working
body: <p>I am trying to take an array of string (Filled from a listbox on a previous page and passed via Session) and display it in a label,<strong>this is how i got the array:</strong> </p>
  
  <pre><code>    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles CheckOut.Click
      Dim x = ListBox1.GetSelectedIndices.Count
      Dim ListPNames(x) As String
      Dim i As Integer
  
      i = 0
      For Each item As String In ListBox1.GetSelectedIndices
          ListPNames(i) = (ListBox1.SelectedItem).ToString
          i = i + 1
  
      Next
  
  
      Session("SlctdPhones") = ListPNames(x)
  
      Response.Redirect("CheckOut.aspx")
  
  
  End Sub
  </code></pre>
  
  <p><strong>And this is how i am trying to display it :</strong></p>
  
  <pre><code>Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
  
  
      Dim SlctdPhones() As String = CType(Session.Item("SlctdPhones"), Array)
      Dim i As Integer
  
      Label3.Text = ""
  
      For i = 0 To SlctdPhones.Length - 1
  
      Label3.Text += SlctdPhones(i).ToString() + Environment.NewLine
      Next
  
  
  End Sub
  </code></pre>
  
  <p>It is giving me an error :<strong>Object reference not set to an instance of an object.</strong> when it reaches the SlctdPhones.Length - 1 Line!!
  i don't know how i can fix it ,also is my array code correct(Is everything being stored correctly in it?) </p>