R
Ryan McLean
Hi everyone! I am trying to be good and use option strict. When I
do, the following code bombs out. A little background:
This is a portion of a class that is my template. This template is
inherited into child classes. This bit of code takes the aspx
contents of the child and adds it into a placeholder the parent page.
Please let me know if there is a better way of accomplishing this of
how I can get rid of this error.
Thanks in advance, have a great week!
Ryan McLean
Protected Sub IterateThroughChildren(ByVal obj As Object)
Dim ctrlcol As Array
Dim i As Integer
ctrlcol = Array.CreateInstance(GetType(Control),
parent.Controls.Count)
Me.Controls.CopyTo(ctrlcol, 0)
Me.Controls.Clear()
Array.Reverse(ctrlcol)
For i = ctrlcol.Length - 1 To 0 Step -1
obj.Controls.Add(DirectCast(ctrlcol(i), Control))
Next
End Sub
The error is in the obj.Controls and ctrlcol(i)
Thanks again!
do, the following code bombs out. A little background:
This is a portion of a class that is my template. This template is
inherited into child classes. This bit of code takes the aspx
contents of the child and adds it into a placeholder the parent page.
Please let me know if there is a better way of accomplishing this of
how I can get rid of this error.
Thanks in advance, have a great week!
Ryan McLean
Protected Sub IterateThroughChildren(ByVal obj As Object)
Dim ctrlcol As Array
Dim i As Integer
ctrlcol = Array.CreateInstance(GetType(Control),
parent.Controls.Count)
Me.Controls.CopyTo(ctrlcol, 0)
Me.Controls.Clear()
Array.Reverse(ctrlcol)
For i = ctrlcol.Length - 1 To 0 Step -1
obj.Controls.Add(DirectCast(ctrlcol(i), Control))
Next
End Sub
The error is in the obj.Controls and ctrlcol(i)
Thanks again!