Controls being absolutely positioned does not have impact on this. As I
said, you need to do it in recursive manner. Page.Controls representys only
the top-level controls on the Page and most probably contains only three
controls (2 literal controls and HtmlForm between them). Your ImageButtons
would be child controls of HtmlForm (since they are contained inside < form
runat="server">), and therefore iterating just Page.Controls won't get them.
Pick up my previous code as is, just change TextBox to ImageButton and use
it. It doesn't loop just Page.Controls but goes through all controls on the
page as it first goes through Page's Controls, checks if each and every
control has child controls and if they have, goes through them too (as long
as there are controls, no matter hpw deep the hierarchy)
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Varangian" <of****@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
I'm doing
foreach (Control ctrl in Page.Controls)
{
if (ctrl is ImageButton)
.... it doesn't work though, i.e. its not finding the ImageButton..
even though the ImageButtons are in the Page. They are in an "absolute"
position.
what should I do ?