[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

name of class

Suppose I have a class called :  

Partial Public Class ShowTds_admin_agencyTable
end class


Is there a way to programmatically, at runtime, obtain the name of the class?
0
HLRosenberger
Asked:
HLRosenberger
  • 2
  • 2
1 Solution
 
käµfm³d 👽Commented:
Obtain it from what? An instance of the class? If so, you would use Reflection.

e.g.

Dim x As New ShowTds_admin_agencyTable
Dim className As String = x.GetType().Name

Open in new window

0
 
HLRosenbergerAuthor Commented:
Yes!  That's what I want.   Now, what about the name of the parent class, if the class is inherited?
0
 
käµfm³d 👽Commented:
Dim parentName As String = x.GetType().BaseType.Name

Open in new window

0
 
HLRosenbergerAuthor Commented:
Thanks so much!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now