Link to home
Start Free TrialLog in
Avatar of stankstank
stankstank

asked on

Looping through controls

I am trying to loop through all checkboxes in my webpage - they are located inside of a multiview control of ASP.NET 2.0.  This is the code I am using, but it does not work:

        foreach (Control ctl in MultiView1.Controls[1].Controls)
        {
            if (ctl is CheckBox)
            {
                CheckBox ch = (CheckBox)ctl;
                Response.Write(ch.Text + " ");
            }
        }

Any ideas?  I can't get it to work. :(

Thank you
ASKER CERTIFIED SOLUTION
Avatar of jvn222
jvn222

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial