Tue, Oct 21 2008
Posted By
Otto R. Radke at 10:15 AM
Body

Linq is pretty amazing.  I'm working on a feature for Boardroom Web where a person can select multiple items that are in a CheckBoxList.  I wanted a quick and easy way to read all of the items they checked.  Here's the Linq statement to read everything that is checked:

 

var selectionResults = from ListItem item in cblAnswers.Items
                       where item.Selected == true
                       select item;

 

I'm not sure if I'm using Linq just to use Linq, but sure seems like a very simple way to get what I needed in this case.

Comments
0 total comments on this post.
Add your comment
 
Name
Email
Website
Comment
Submit
Search
About Me

Otto R. Radke is the one of the founders of iTech Northwest, a Microsoft .NET software company specializing in collaboration, communication, and integration applications and services.

More...

 

Otto R. Radke ottoradke.com and all content copyright © 1969-2008 by Otto R. Radke, unless otherwise noted.
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Top of Page