How to retrieve a control with a certain property from a collection of Controls?

Gasper

New Member
I create a menu application in an ASP.NET app like this:\[code\]// HTML<td runat="server" id="container">// C#. This logic is creating// within a LOOPLabel l = new Label("name_blabla");// i is the loop indexl.ID ="id"+ i;Panel p = new Panel();p.Add(l);container.Controls.Add(p);\[/code\]So the container has only one panel containing only one label with this \[code\]id\[/code\] assigned.The purpose is to get this panel from the container once all controls are inserted. And once I retrieved this panel I also need to get the 2 next to it in the collection. I don't know the position where it is inserted. Better with LINQ.
 
Back
Top