How to check if an item exists in more than one listbox? ASP.NET/C#
<p>I have three sets of listboxes, I move items from lb1 to lb2, from lb3 to lb4 and from lb5 to lb6. The listboxes on the left contains the same items and I don't want the user to be able to submit the page if one or more items from the left listboxes is added to more than one listbox to the right. For example, item A in lb1, lb3 and lb5 can only be saved in either lb2, lb4 or lb6, not in two or three of them.</p>

<p>I want to perform this check before submitting the page (and later on I will add validation with javascript) and I wonder what is the most efficient way to do this. </p>

<p>Add all items to a list and check if there are any duplicates?</p>

<p>Thanks in advance.</p>

<p>Edit:
something like this:</p>

<pre><code>            List&lt;string&gt; groupList = new List&lt;string&gt;();
            foreach (ListItem item in lbFullAccess.Items)
            {
                groupList.Add(item.Value.ToString());
            }
            foreach (ListItem item in lbContributor.Items)
            {
                groupList.Add(item.Value.ToString());
            }
            foreach (ListItem item in lblReadOnly.Items)
            {
                groupList.Add(item.Value.ToString());
            }
</code></pre>
