Loop through all controls on asp.net webpage

后端 未结 7 1428
攒了一身酷
攒了一身酷 2020-12-01 22:17

I need to loop through all the controls in my asp.net webpage and do something to the control. In one instance I\'m making a giant string out of the page and emailing it to

7条回答
  •  借酒劲吻你
    2020-12-01 22:49

    sub getcontrols(byref c as control, byref allControls as list(of control)
    if c isnot nothing
    allcontrols.add(c)
    if c.controls.count>0 then
    for each ctrl as control in c.controls
    getcontrols(ctrl,allcontrols)
    next
    end if
    

提交回复
热议问题