I have a control named as ShoppingCartControl. In it, there is an update button. The code behind that is :-
protected void ctrlShoppingCart_ItemUpdating(object sender, ItemEventArgs e)
{
ShoppingCartControl control = sender as ShoppingCartControl;
int qty=0;
foreach (var c in control.Items)
{
int recid = ((ShoppingCartControlItem)c).ShoppingCartRecId;
if (recid == e.ID && e.ID!=null)
{
qty = ((ShoppingCartControlItem)c).Quantity;
}
}
cart.SetItemQuantity(e.ID, qty);
Response.Redirect("shoppingcart.aspx");
}
Can anyone explain me this code step by step or what is meant by
"sender as ShoppingCartControl".
Thanks and Regards
Akiii