I need to loop thru a number of dynamically created Tables on a page.
Each table has a number of rows with cells and buttons all dynamically created.
I need to be able to loop thru all elements in a script.
Any help with this would be greatly appriciated.
Larry
IterateControls(Me.Controls)Private Sub IterateControls(ByVal cs As ControlCollection)
Dim c As Control
For Each c In cs
If TypeOf c Is Table Then
'do something with your tables
End If
IterateControls(c.Controls)
Next
End Sub
This'll iterate through all your controls, I've added an if/then to check if it is a table or not.
Hope this helps,
--Michael
Now how do you intend to do it in javascript? By the time you get to that point, it is just a rendered page in html, the "control" mentality of asp.net is gone. The best I think you can do in javascript is to use the function getElementByID(), but you have to know the id first!.
Why are you trying to do this anyway? There has to be an easier way.
Micxhael,
Thanks for the reply.
This seems to be in code behind and I need to do this in Javascript so there is no postback.
Can youhelp with Javascript?
Larry
0 comments:
Post a Comment