Hi
I am trying to pass information between two asp.net page. user select item from check list box and calculate how many time add to cart. could any one told me what is problem with my code?
thank you
protected void btnAdd_Click(object sender, EventArgs e)
{
if(itemListchk.SelectedItem != null)
{
int totalNumberItems = 0;
foreach (ListItem li in itemListchk.Items)
{
if (li.Selected == true)
{
string itemName = itemListchk.SelectedItem.ToString();
string itemValue = itemListchk.SelectedValue.ToString();
HttpCookie cookie = new HttpCookie(itemName, itemValue);
totalNumberItems++;
totalNumberItem += Convert.ToInt16(li.Value);
Response.Cookies.Add(cookie);
}
Label1.Text = "You have \ " + totalNumberItems.ToString() + "\ items in your cart ";
}
}
}