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
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