C# 3.5 : How do I get the name of the parent class from a UserControl?
<p>C# 3.5 : How do I get the name of the parent class dynamically from within a UserControl? </p>

<p>For example, </p>

<p>If <strong>TestPage.aspx</strong> contains UserControl <strong>ucTestUc</strong>,</p>

<p>I need to know that the parent class is TestPage.</p>

<p>I tried: from within <strong>ucTestUc</strong>, </p>

<p><strong>this.Parent.NamingContainer</strong> is  ASP.testpage_aspx . </p>

<p>Which is close, but no cigar. </p>

<p>I could get rid of the prefix and postfix, but I have no way of restoring the capitalization. </p>

<p>?</p>
