C
clintonG
Somebody help me learn which class and methods may be used to get the names
of all properties for a given server control? Thank you...
of all properties for a given server control? Thank you...
clintonG said:Somebody help me learn which class and methods may be used to get the names
of all properties for a given server control? Thank you...
Derek Harmon said:Somebody help me learn which class and methods may be used to get the names
of all properties for a given server control? Thank you...
Clinton,
The classes you should look at are in the System.Reflection namespace. Usually,
you'll start out by calling GetType( ) on an object (it can be any object, it doesn't
need to be a server Control) and from a Type object you can query all sorts of
CLR metadata on that type such as it's properties.
using System.Reflection;
// . . .
PropertyInfo[ ] props = serverControl1.GetType( ).GetProperties( );
Gets you all of the public instance properties on the serverControl1's Type as
an array of PropertyInfo objects (which have properties like Name and
PropertyType that describe the nature of the property).
Derek Harmon