<p>How do I set a property of a user control in <code>ListView</code>'s <code>LayoutTemplate</code> from the code-behind?</p>

<pre><code>&lt;asp:ListView ...&gt;
&lt;LayoutTemplate&gt;
&lt;myprefix:MyControl id="myControl" ... /&gt;
&lt;/LayoutTemplate&gt;
...
&lt;/asp:ListView&gt;
</code></pre>

<p>I want to do this:</p>

<pre><code>myControl.SomeProperty = somevalue;
</code></pre>

<p>Please notice that my control is not in <code>ItemTemplate</code>, it is in <code>LayoutTemplate</code>, so it does not exist for all items, it exists only once. So I should be able to access it once, not for every data bound item.</p>

Use the
FindControl
method on each ListViewItem.
```
```
var control = (MyControl)Item.FindControl("yourControlId");
```
```