Hello 2 all,
I have the following problem in finding the property value from the loaded assembly (control).
I am the following setup:
Language: C#
OS: WinXP
MVS 2005/2008
.NET 2.0 - 3.5
Written a base class called "baseOne" (on a separate Assembly), inside this I have a string property "myValue" (with get & set)
Written another class called "formOne" (on a separate Assembly) by referring to the "baseOne" class. On this formOne, have placed a listbox and on click of an item on the listbox, am trying to assign the selected value into the Property "myValue"
So far no issues.
On the main application, along with code for the form creation, have code to handle the form "Clicked" method.
Inside this click method, I have the following code:
Type senderType = sender.GetType();
PropertyInfo idInfo = senderType.GetProperty("myValue");
string id = String.Empty;
if (idInfo != null)
id = idInfo.GetValue(sender, null).ToString();
-- issue --
MessageBox.Show(id); //resulting blank
I tried to debug through the code, the property "myValue" value been retrieved from "baseOne" and not from the "formOne"!
Anyone? Would appreciate help on the issue...
*Hope it is not confusing, if so, would re-do the post