Using LINQ, how do you get all label controls.
Posted
by John
on Stack Overflow
See other posts from Stack Overflow
or by John
Published on 2010-04-07T16:48:40Z
Indexed on
2010/04/07
16:53 UTC
Read the original article
Hit count: 145
I want to get a collection of all label controls that are part of a user control. I have the following code:
var labelControls = from Control ctl in this.Controls
where ctl.GetType() == typeof(Label)
select ctl;
but the result is zero results.
Please assist. Thanks.
© Stack Overflow or respective owner