I just came across an issue where my code throws an exception when looping through the controls on a web page. The page includes a timer control and that seems to be causing the problem.
I loop through the controls like this:
For Each cntrl As WebUIControl In Self.Controls
System.DebugLog(cntrl.Name)
Next
When the code reaches the timer control it halts on the “Next” statement and I get an “IllegalCastException” with this as the reason “WebTimer cannot be cast to WebUIControl”.
I am seeing the names of the controls on my web page until it fails with the exception.
So you can’t iterate through the control collection on any page that includes a timer? That complicates things.
Can anyone tell me how to work around this issue?
-Wes
PS. I’m running Xojo Version 2021 Release 1.1 if that matters.