Hi
I am busy building a shopping cart with cookies. I have datalist which I populate from the cookies with a delete button next to each cookie
Here is the code:public partial class Basket_Checkout : System.Web.UI.Page
{
//List<ProductItemObject> ProductsList = new List<ProductItemObject>();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindList();
}
}
private void BindList()
{
dlstProducts.DataSource = null;
dlstProducts.DataSource = ProductsList();
dlstProducts.DataBind();
}
public List<ProductItemObject> ProductsList()
{
StringBuilder sb = new StringBuilder();
int loop1, loop2;
HttpCookieCollection MyCookieColl;
HttpCookie MyCookie;
MyCookieColl = Request.Cookies;
// Capture all cookie names into a string array.
String[] arr1 = MyCookieColl.AllKeys;
// Grab individual cookie objects by cookie name.
List<ProductItemObject> CurrentBasket = new List<ProductItemObject>();
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
ProductItemObject item = new ProductItemObject();
MyCo
View Complete Post