how to get child class "name" from parent class

E

encapsul

..net 1.1 In a webpage I am using a base class for user controls and want to
detect the NAME of the child class from the base class.

As in:

1) base class A
2) child class "test class"
3) child class inherits base class
- the base class is able to detect "test class" as the class that is
inheriting it.

Some code for you:

Public Class baseUserControlClass
Inherits System.Web.UI.UserControl
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
'... get the calling class NAME here
' which is "bu_basic_info" from the code below.

Dim childControlName As String = ????
MyBase.OnLoad(e)
End Sub
End Class

--- code from the webpage---

Public Class bu_basic_info

Inherits prj10.baseClasses.baseUserControlClass

' application logic follows

End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top