How to store previous selected item from `DropDownList`
<p>I have a <code>DropDownList</code>, using which I have to store some values from the <code>CheckBoxList</code> in the database.</p>

<p>Before I select another index from the <code>DropDownList</code>, the values in the <code>CheckBoxList</code> has to be stored, prompting the user with an alert "Save before proceeding".</p>

<p>I am able to display the above mention alert message. But the problem is once i change the index it <code>DropDownList</code>, the previous selected index is lost.</p>

<p>Can someone kindly help me getting the previous selected value and select the same dynamically in <code>DropDownList</code>. Because the value is need to store in database.</p>

<p>The code for displaying alert message is:</p>

<pre><code>protected void LOC_LIST2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (CheckBoxList2.Items.Count &gt; 0)
        {
            Label7.Visible = true;
            Label7.Text = "*Save List Before Proceeding";
        }
</code></pre>
