There's lots of ways of doing this, but here's one simple way. (This code will need to be in your page code behind because it requires the Page.Session property)
To start with, you may want a Product entity to store your data:
[Serializable]
public class Product
{
public int ProductId{get;set;}
public int Price{get;set;}
public int Number{get;set;}
}
Then you can store your products in session like this:
public void AddProductToSession(Product product)
{
var products = Session["goods"] as Dictionary<int, Product>;
if (products == null) products = new Dictionary<int, Product>();
products.Add(product.ProductId, product);
Session["goods"] = product;
}
public Product GetProductFromSession(int productId)
{
Product product;
var products = Session["goods"] as Dictionary<int, Product>;
if (products == null || !products.TryGetValue(productId, out product))
throw Exception(string.Format("Product {0} not in session", productId));
return product;
}