C# 3.5 : How do I get the name of the parent class dynamically from within a UserControl?
For example,
If TestPage.aspx contains UserControl ucTestUc,
I need to know that the parent class is TestPage.
I tried: from within ucTestUc,
this.Parent.NamingContainer is ASP.testpage_aspx .
Which is close, but no cigar.
I could get rid of the prefix and postfix, but I have no way of restoring the capitalization.
?
1 Answer