Displaying Parent/Children name with indent
<p>i have an object that have parent/children relationship.</p>

<p>below is shorter version of what i have but the below is the core props</p>

<pre><code>public class Company
{
  Name {get;set;}
  List&lt;Company&gt; ChildCompany {get;set;} 
}
</code></pre>

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

<pre><code>-----ABC Corporation (in this chas ABC has child company so it will display right indent)
----------ABC Child
----------ABC One
----------ABC Two
-----BBC Corporation (in this case no child company)
-----CBS

-----CNN Corporation
----------ABC
----------BBC
----------NBC
</code></pre>

<p>my code:</p>

<pre><code>Company company = new Company();
company = GetDataForCompany(); //DAL

if(!string.IsNullEmpty(company.Name))
{

     //dispaly Name
     PlaceHolder ph;
     l = new Literal();
     l.Text = "&lt;ul&gt;" + Environment.NewLine;
     ph.Controls.Add(l);
     l = new Literal();
     l.Text = "&lt;li"&gt;";
     ph.Controls.Add(l);
     hl = new HyperLink();
     hl.Text = company.Name;
     ph.Controls.Add(hl);


    foreach (Company item in company)
    {
          l = new Literal();
          l.Text = "&lt;li"&gt;";
          ph.Controls.Add(l);
          hl = new HyperLink();
          hl.Text = item.Name;
          ph.Controls.Add(hl);
    }

}
</code></pre>

<p>the above code does not seems to rendering exactly what i wanted as shown above.</p>
