Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > how to get child class "name" from parent class

Reply
Thread Tools

how to get child class "name" from parent class

 
 
encapsul
Guest
Posts: n/a
 
      09-15-2005
..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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      09-15-2005
Is "Me.GetType().FullName" what you're loking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen

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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
child jitter vs parent shaping vs child class-default on 871 and 1841 Robertas Cisco 0 02-23-2007 01:28 PM
Parent - Child back to parent javascript thingybob mark ASP .Net 1 03-10-2005 02:20 PM
Pass from parent to child, then update parent with child value... Noel Dolan Javascript 0 07-18-2004 05:52 PM



Advertisments