Using Linq to Find a Control

.net Oct 29, 2010

I think Every one has one time or the other tried to find a control by looping over and find the required control, but we can use Linq to do the same thing.

Then you can use as a Linq Expression

var ctrls = controls.All().Where(c => c.GetType() == typeof(Button));