ViewState to compare CheckBoxList Selected Values
<p>I have a button that creates a <code>CheckBoxList</code>. The items in the <code>CheckBoxList</code> are selected based on a user's current notification subscriptions. I'm storing the true or false value of the selected item.</p>

<p>After the users change their subscriptions by checking or unchecking a box in the <code>CheckBoxList</code>, they click another button to update their notification subscriptions. I need to compare the <code>Viewstate["PREV"]</code> with the changed selections on postback and run some functions based on the changes.</p>

<pre><code>ArrayList list = new ArrayList();
for (int i = 0; i &lt; checkBoxList1.Items.Count; i++)
{
    list.Add(checkBoxList1.Items[i].Selected.ToString());
}
ViewState["PREV"] = list;
</code></pre>

<p>Even though I can't see the values with a <code>Response.Write</code>, the values for the ViewState are correct when I add a watch in debug.</p>

<p>The problem I'm having is how to approach the next step to do the comparison. This is what I want to accomplish:</p>

<pre><code>            for (int i = 0; i &lt; checkBoxList1.Items.Count; i++)
        {
            //if checkbox state goes from false to true, subscribe to topic
               //mySubscribeMethod
            //else if checkbox state goes from true to false, unsubscribe to topic
               //myUnsubscribeMethod
            //else if checkbox state is unchanged, do nothing
        }
</code></pre>
