E
Eric Sabine
This is for a web app but I figured it's more of a lanugage Q:
I have a user control which is going to be used by multiple web pages.
In the web control I need to get the bool value of a public property.
All of the web pages implement an interface with this property.
In the user control, I was going with Reflection to learn this value
but I need help with the code
PropertyInfo pi =
this.Page.GetType().GetProperty("IncludeMerchantOwned");
if (pi != null)
{
object o = null;
// the line below is my problem
m_includeMerchantOwned = (bool)pi.GetValue(o, null);
}
I'm sure it's the object o. This is where I need help.
Eric
I have a user control which is going to be used by multiple web pages.
In the web control I need to get the bool value of a public property.
All of the web pages implement an interface with this property.
In the user control, I was going with Reflection to learn this value
but I need help with the code
PropertyInfo pi =
this.Page.GetType().GetProperty("IncludeMerchantOwned");
if (pi != null)
{
object o = null;
// the line below is my problem
m_includeMerchantOwned = (bool)pi.GetValue(o, null);
}
I'm sure it's the object o. This is where I need help.
Eric