I can't see what's wrong with this code:
var listShoppingCart = Session["ShoppingCart"];
foreach (var item in listShoppingCart)
{
}
I get a red line below the listShoppingCart in the foreach loop. When I hover over the red line, the messages is that Foreach statement cannot operate on variables type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
I declare the list with a session like this:
Session["ShoppingCart"] = new List<Products>();