Saturday, March 31, 2012

Strange behavior

Hello guys,
I have a strange behaviour in my asp.net web page. My page
contains a datagrid control, which has another nested
datagrid as a user control. It works very well, when the
user expands the + button or closes it with the same
buton. However when I do this several times successively
then suddenly I got the error message:
Object reference not set to an instance of an object.
objGetDailyStoreQuantitySold.StartDate = CType(e.Item.Cells
(0).FindControl("lblInvoiceDate"), Label).Text
When I do a refresh then it sees the label control again.
I am somehow why this is happening. Can somebody
help?
ThanksBy looking at this code, all one could really say is that:
objGetDailyStoreQuantitySold could be Nothing.
e could be Nothing.
e.Item could be Nothing
e.Item.Cells could be Nothing
...
etc.
You'll need to show a little more code or step through with a debugger
to get more details. Know what I mean?
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 10 Feb 2005 08:01:10 -0800, "anonymous"
<anonymous@.discussions.microsoft.com> wrote:

>Hello guys,
>I have a strange behaviour in my asp.net web page. My page
>contains a datagrid control, which has another nested
>datagrid as a user control. It works very well, when the
>user expands the + button or closes it with the same
>buton. However when I do this several times successively
>then suddenly I got the error message:
>Object reference not set to an instance of an object.
>objGetDailyStoreQuantitySold.StartDate = CType(e.Item.Cells
>(0).FindControl("lblInvoiceDate"), Label).Text
>
>When I do a refresh then it sees the label control again.
>I am somehow why this is happening. Can somebody
>help?
>Thanks

0 comments:

Post a Comment