asp.net website listbox selectedindex
<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        Label2.Text = ListBox1.SelectedIndex.ToString();

    }
</code></pre>

<p>if <code>label2.text</code> is written in page load then its output is -1</p>

<pre><code>protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label2.Text = ListBox1.SelectedIndex.ToString();
    }
</code></pre>

<p>if i write <code>label2.text</code> in selected index change it returns nothing.
please help me out.</p>
