以下の命名規則によって存在することがわかっているページ上の複数のラベルのテキスト プロパティを更新しようとしています。ただし、この方法でそれらにアクセスしようとすると、常に「入力文字列の形式が正しくありませんでした」というエラーが発生します。
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