Fill Array List with All properties of a class
Partner links
Following Method/function will return list of class properties in an array list.
PropertyInfo class is is used to get the properties of the object passed to the method parameter. You may need to add System.Refelection directive in your page.
I am using this in my web development. Microsoft c-sharp , .net, .aspx
private ArrayList getPropertis(object obj)
{Type objtype = obj.GetType();
ArrayList arrayproperties = new ArrayList();foreach (PropertyInfo pi in objtype.GetProperties()){
arrayproperties.Add(pi.Name);}return arrayproperties;}
Tags: array, arraylist, Asp.net, c#, fill array list, get class properties list, properties














