Link to home
Start Free TrialLog in
Avatar of halaharr
halaharr

asked on

LINQ query problem, Please help.

Hi,  
    I am trying to find all the check box that are checked on a html form in an asp.net page using LINQ query and I am having some problem. I am not sure what I am doing wrong.

IEnumerable<string>  cbChecked = Request.Form.Cast<string>().Where(c => c.Contains("cb_"));

I checked the form and it contains all the check boxes check.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of johnaryan
johnaryan
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of halaharr
halaharr

ASKER

Correct solution was
IEnumerable  cbChecked = Request.Form.OfType().Where(c => c.Contains("cb_"));

But it helped me to to think that option.

Thanks