Adding controls to render tree in ascx
<p>I have a user control class like this:</p>

<pre><code>///MyUserControl.ascx.cs
///.......
public partial class MyUserControl
  : UserControl
{
  //....
  public List&lt;HyperLink&gt; Items
  {
    get
    {
      return _Items;
    }
  }
  public string RenderControl(WebControl control)
  {
      StringBuilder sb = new StringBuilder();
      using(StringWriter stringWriter = new StringWriter(sb))
      {
        HtmlTextWriter writer = new HtmlTextWriter(stringWriter);
        control.RenderControl(writer);
      }
      return sb.ToString();
   }
  //....
}
</code></pre>

<p>I want to add all <code>Items</code> to render tree in ascx:</p>

<pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyUserControl.ascx.cs" Inherits="MyUserControl" %&gt;
    &lt;%foreach (var item in Items){%&gt;
      &lt;div&gt;
        &lt;%=RenderControl(item)%&gt;
      &lt;/div&gt;
    &lt;%}%&gt;
</code></pre>

<p>But it's ugly solution. Does anybody know better solution?</p>
