2014年8月13日 星期三

迴圈開control ID

For i = 2 To 17
                Dim ltemp As Label
                ltemp = DirectCast(FindControl("Label" & i), Label)
                ltemp.Text = "0"
            Next

            For i = 0 To sMTPLD.Length - 1
                DirectCast(FindControl("TextBox" & i + 1), TextBox).Text = ""
                DirectCast(FindControl("TextBox" & i + 17), TextBox).Text = ""
                DirectCast(FindControl("DetailHyperLink" & i + 1), HyperLink).NavigateUrl = ""
            Next

沒有留言:

張貼留言