I am trying to find out how to list the properties of a class that is in a session variable, and having no luck
i know that i can instance the class like so in a generic handler
IAdvanceUser user = context.Session["advUser"] as IAdvanceUser;
or like this in an aspx
IAdvanceUser user = new.SunGardHE.WebFramework.Security.AdvanceUser();
but i can seem to get reflection to work from this SO How to get the list of properties of a class?
IAdvanceUser user = new.SunGardHE.WebFramework.Security.AdvanceUser();
foreach(var prop in user.GetType().GetProperties()) {
Console.WriteLine("{0}={1}", prop.Name, prop.GetValue(user, null));
}
it doesnt error, but doesnt show any output either