I have this code that sets the profile value in a button click event:
if (prod != null)
{
ShoppingCart cart = (ShoppingCart)HttpContext.Current.Profile.GetPropertyValue("ShoppingCart");
cart.InsertItem(ProductID, prod.Title, prod.SKU, prod.UnitPrice, attrs, int.Parse(ddlQuantity.SelectedValue), prod.SmallImageID);
HttpContext.Current.Profile.SetPropertyValue("ShoppingCart", cart);
rptCart.DataSource = (HttpContext.Current.Profile.GetPropertyValue("ShoppingCart") as ShoppingCart).Items;
rptCart.DataBind();
}
when this code executes and repeater databinds, repeater shows the inserted item, but as soon as the page loads and this code executes:
rptCart.DataSource = (HttpContext.Current.Profile.GetPropertyValue("ShoppingCart") as ShoppingCart).Item ...
Go to the complete details ...