c# - Remove a particular item from a list which is in a session -
list<shoppingcartview> removeitem = (list<shoppingcartview>)session["shoppingview"];
i want remove row on clicking particular product. example if click on product xxx , want remove product xxx session["shoppingview"], rest of list should remain same.
you have edit condition accordingly
var list = (list<shoppingcartview>)session["shoppingview"]; session["shoppingview"] = list.where(x => x.productname!= "pname").tolist();
Comments
Post a Comment