Iterate through Panels

  • Thread starter Thread starter Fabian
  • Start date Start date
F

Fabian

In my ASP.NET page I create panel controls dynamically. Now, I will loop
through all my dynamically created panels.

How I can do this?



Thanks for help

Fabian
 
Panels are added to the control collection of the page. As such, the only way
I know is to loop through controls and using GetType() to figure if it is a
Panel object.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Hello Cowboy (Gregory A. Beamer) - MVP,

How about

foreach (Panel p in this.Controls)
{
// do something
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top