File: App_Code\ShoppingCart.cs
using System;
using System.Collections.Generic;
using System.Web.Profile;
namespace MyNamespace
{
public class ShoppingCart
{
private List _items = new List();
public List Items
{
get { return _items; }
}
}
public class CartItem
{
private string _name;
private decimal _price;
private string _description;
public string Name
{
get { return _name; }
set { _name = value; }
}
public decimal Price
{
get { return _price; }
set { _price = value; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public CartItem() { }
public CartItem(string name, decimal price, string description)
{
_name = name;
_price = price;
_description = description;
}
}
}
File: Web.Config
File: Default.aspx
<%@ Page Language="C#" %>
<%@ Import Namespace="MyNamespace" %>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Show ShoppingCart