 <p>The problem in your code is that, on the first button click, you are adding the value to the ArrayList, of which the state is not saved during the post back. Which means, on the Button2_Click event the array list will always be empty.</p> <p>Change your value property something like this. Or Save the Arraylist value to the session in the DataList1_ItemCommand event itself</p> <pre><code>ArrayList value { get { ArrayList values = null; if(ViewState["selectedValues"] != null) values = (ArrayList)ViewState["selectedValues"]; else { values = new ArrayList(); ViewState["selectedValues"] = values; } return values; } } </code></pre>