Hi,
"alex" <ea***********@freenet.de> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hi,
i get a NULLReferenceException when executing this:
CheckBox aBox = new CheckBox();
aBox = this.GetType().GetField("checkBox9").GetValue(this ) as CheckBox;
I have a Checkbox with the name checkBox9, and other code snippets gets
the object the same way.
Any ideas to get the object on an other way?
Is this a web or a win app?
In web app you can do this.FindControl( ControlName );
In a win app it does change GetField does work ONLY if the control is
defined as a field, IF the control is added dynamically it will not appear.
I don't think you have other option but do a search in the Controls
collection
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation