I am trying to update the text property of multiple labels on my page that I know exist by the naming convention I have below. However when I try to access them in this way I always get an "Input String was not in correct format" error.
For i = 1 To 5
Dim title As Label = CType(Me.Controls("title" & i), Label)
title.Text = alist(i * section).inDate
Dim postDate As Label = CType(Me.Controls("postDate" & i), Label)
postDate.Text = alist(i * section).inDate
Dim depart As Label = CType(Me.Controls("depart" & i), Label)
depart.Text = alist(i * section).department
Dim mess As Label = CType(Me.Controls("mess" & i), Label)
mess.Text = alist(i * section).message
Next