Archive of stories published by ediblecode

How to loop through listbox items with LINQ in ASP.NET C#

Normally if you’re looping through a list of items in a ListBox (or CheckBoxList etc) you’d probably do something like this:

[sourcecode language=”csharp”]
foreach (ListItem li in LstBx.Items)
{
 if…

These were the top 10 stories published by ediblecode; you can also dive into yearly archives: 2009, 2010, 2011, 2012, 2013, 2014, 2017, and 2018.