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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -