Wednesday, March 28, 2012

Web Control array

I have 3 labels, possibly more, that will all have the same string, a "*". Basically I want to initialize these labels on page load to have an asterisk by required fields, and become red when the page is invalid.

My question is: Can I somehow refer to labels as arrays so I can use a loop structure instead of assigning variables individually? For instance...


Sub PageInitialize()
For i = 1 To 3
lblAsterisk(i) = "*"
Next
End Sub

Thanks in advance,

_Mbtw, if anyone has a more efficient way of accomplishing the above, or the above is way off and there is a similar way of doing the same task, let me know! Thanks.

0 comments:

Post a Comment