.net - method to search through all controls and only picking out a certain type -
i looking methods can loop through controls on page , pick out types. in case, looking html element textarea.
i have loop...
for each control htmltextarea in mydiv.controls.cast(of htmltextarea)() if typeof control htmltextarea ...do something... end if next
but fails when reaches control other htmltextarea saying unable cast said control htmltextarea.
thanks
you need use oftype
instead of cast
.
for each control htmltextarea in mydiv.controls.oftype(of htmltextarea)() 'if no longer needed, control htmltextarea ...do something... next
msdn oftype
Comments
Post a Comment