J
jamesb457
I'm getting this error a lot, it was working reasonably well, but then
for no apparant reason, it stopped.
I have a class, basically:
public class ShoppingBasket
{
int count;
String[] Items;
public AddItem()
}
Im trying to save this objectto a session so i can use it after
postback.
protected Add_To_Basket(data)
{
mycart.AddItem();
Session["shopbasket"] = mycart;
}
and then restore it:
protected void Page_Load(object sender, EventArgs e)
{
ShoppingBasket shopcart = (ShoppingBasket)Session["shopcart"]; //
this line here error's.
}
But i keep getting the error
Unable to cast object of type 'ShoppingBasket' to type
'ShoppingBasket'
Can anyone help?
for no apparant reason, it stopped.
I have a class, basically:
public class ShoppingBasket
{
int count;
String[] Items;
public AddItem()
}
Im trying to save this objectto a session so i can use it after
postback.
protected Add_To_Basket(data)
{
mycart.AddItem();
Session["shopbasket"] = mycart;
}
and then restore it:
protected void Page_Load(object sender, EventArgs e)
{
ShoppingBasket shopcart = (ShoppingBasket)Session["shopcart"]; //
this line here error's.
}
But i keep getting the error
Unable to cast object of type 'ShoppingBasket' to type
'ShoppingBasket'
Can anyone help?