title: How to check if a control is child of another control? "Control.IsChildOf"
body: <p>I have 3 panels:</p>
  
  <pre><code>&lt;asp:Panel ID="ParentPanel" runat="server"&gt;
      &lt;asp:Panel ID="AnnoyingPanel" runat="server"&gt;
          &lt;asp:Panel ID="P" runat="server"&gt;
          &lt;/asp:Panel&gt;
      &lt;/asp:Panel&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>How can I check if <code>P</code> is child of <code>ParentPanel</code>? Is there some LINQish way to do it?</p>
  
  <p>Is there some more optimized way than the one I provided? Maybe using Linq?</p>