In want to add dynamically the properties or methods of a user control from the code behind like this:
foreach (DataRow drModuleSettings in dsModuleSettings.Tables[0].Rows)
{
if (!string.IsNullOrEmpty(dsModuleSettings.Tables[0].Rows[0]["SettingValue"].ToString()))
userControl.Title = dsModuleSettings.Tables[0].Rows[0]["SettingValue"].ToString();
}
The "userControl.Title" is a sample, in fact it should be replaced by such a code:
userControl.drModuleSettings["SettingName"] = dsModuleSettings.Tables[0].Rows[0]["SettingValue"].ToString();
The problem is I don't know how to do this.
Please someone help me.
Thanks!