Finding an item in a repeater control?
<p>This one might be simple, but here it is anyway.</p>

<p>I have a <code>List&lt;Object&gt;</code> that I bind to a repeater. The repeater binds all of the fields to textboxes <strong><em>except <code>Id</code></em></strong>. In my web page, whenever a user adds a new item, I create a new <code>Object</code> in my list with a unique <code>Id</code> and rebind my repeater.</p>

<p>At a certain point in my code, I am trying to read the textbox controls from the repeater and put them into my <code>List&lt;Object&gt;</code>. However, I need access to the <code>Id</code> field to know which List item to insert into. How can I get the specific <code>Id</code> while I'm going through the repeater?</p>

<p>I know I can just create a hidden field with the Id in the repeater control and get it that way, but is there a cleaner way to do this?</p>

<p>Example: </p>

<pre><code>if (DependentRptr.Items.Count &gt; 0)
{
    for (int count = 0; count &lt; DependentRptr.Items.Count; count++)
    {
        int did = (form.UserId + (count + 1)); //I'm trying to get the id of this field here.
        ...get control info...

        var temp = AddedDependents.ToList().Find(p =&gt; p.Id == did); //here is where I search with the id
    }
}
</code></pre>
