ipjyo
asked on
How to check if a property exists on an object and get the value of that property using reflection?
hi,
I need to check if a property exists on an object and get the value of that property if the property exists.
I have the attached code.
Thanks for any suggestions.
I need to check if a property exists on an object and get the value of that property if the property exists.
I have the attached code.
Thanks for any suggestions.
PropertyInfo info;
foreach (Field FO in section.FOCollection)
{
info = Myobj.GetType().GetProperty(FO.Node);
}
if(info!=null)
{
//get the value
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER