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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -