M
Monty
Hi All,
I have a user control that shows name and address for a person in a text
box. When the page hosting the control loads up, it calls a method on the
user control that loads up the textbox fields. Occasionally, but not all the
time, I will get an error when I try to set the value of one of the
controls. The error message is "Object reference not set to an instance of
an object". I used to get this (I believe more frequently but am not sure)
when I called the user control's method from the page's Load event, so I
moved it to the page's PreRender event, but I still get the error every now
and again. The line it's occurring on looks like this:
txtAddress1.Value = Left$(sAddressBlock, iPos - 1)
The textbox "txtAddress1" definitely exists and works > 90% of the time. Any
thoughts? TIA!
I have a user control that shows name and address for a person in a text
box. When the page hosting the control loads up, it calls a method on the
user control that loads up the textbox fields. Occasionally, but not all the
time, I will get an error when I try to set the value of one of the
controls. The error message is "Object reference not set to an instance of
an object". I used to get this (I believe more frequently but am not sure)
when I called the user control's method from the page's Load event, so I
moved it to the page's PreRender event, but I still get the error every now
and again. The line it's occurring on looks like this:
txtAddress1.Value = Left$(sAddressBlock, iPos - 1)
The textbox "txtAddress1" definitely exists and works > 90% of the time. Any
thoughts? TIA!