A
Alexander Widera
hi,
i have the following problem in the following code:
Basket basket = (Basket) Session["Basket"];
if (basket.isEmpty)
{
...........
}
Basket is a class which i have created myself. It has a function isEmpty of
the type bool.
This code is in a ascx-page (usercontrol).
Now the problem. Sometimes I call a page, which includes the usercontrol all
works, but sometimes i get the errormessage "Object reference not set to an
instance of an object."
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Line 51: if (basket.isEmpty)
Why does this happen? Sometime it works and sometimes not?
Does somebody know this problem?
Thank you.
i have the following problem in the following code:
Basket basket = (Basket) Session["Basket"];
if (basket.isEmpty)
{
...........
}
Basket is a class which i have created myself. It has a function isEmpty of
the type bool.
This code is in a ascx-page (usercontrol).
Now the problem. Sometimes I call a page, which includes the usercontrol all
works, but sometimes i get the errormessage "Object reference not set to an
instance of an object."
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Line 51: if (basket.isEmpty)
Why does this happen? Sometime it works and sometimes not?
Does somebody know this problem?
Thank you.