Looping through webcontrols

Results 1 to 2 of 2

Thread: Looping through webcontrols

  1. #1
    Join Date
    Dec 1969

    Default Looping through webcontrols

    i used the following code for walking through a controlcollection. (in my sample i walkthrough a Page.Controls object) <BR><BR>i used: RenderAllControl(Page.Controls); <BR><BR>below you&#039;ll find this method: <BR><BR>public void RenderAllControls(ControlCollection ctrlColl) <BR> { <BR> foreach(Control ctrl in ctrlColl) <BR> { <BR> if(ctrl is System.Web.UI.WebControls.Table) <BR> { <BR><BR> } <BR><BR> if(ctrl is System.Web.UI.WebControls.Button) <BR> { <BR> RenderButton(((System.Web.UI.WebControls.Button)ct rl)); <BR> } <BR><BR> if(ctrl is System.Web.UI.WebControls.TextBox) <BR> { <BR> RenderTextBox(((System.Web.UI.WebControls.TextBox) ctrl)); <BR> } <BR> } <BR> } <BR><BR><BR>====== <BR>How to make a recursive check for tables (i.e. to find tablerows with tablercells with other controls). <BR><BR>i hope someone has the answer ! :-)<BR><BR>GR <BR><BR>Rudolph <BR>

  2. #2
    Join Date
    Dec 1969

    Default Please do NOT Cross-Post

    If you don&#039;t know what that means, read the FAQs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts