Hi,
I wrote the below code to assign the value to a text box with the sum of every nth textbox value in the given range.
Sub GetHSum(startControl As Integer, endControl As Integer) Dim xsum As Integer, i As Integer, T As TextBox xsum = 0 For i = startControl To endControl Step 5 If String.IsNullOrEmpty(FindControl("Textbox" & i).text) Then xsum = xsum + 0 Else If xsum = 0 Then xsum += Convert.ToInt32(FindControl("Textbox" & i).text) Else xsum += Convert.ToInt32(FindControl("Textbox" & i).text) End If End If Next FindControl("Textbox" & i + 5).text = xsum End Sub
Receiving Error for the above code. Can some one help me on how to reference the textbox control and get the value while iterating through the loop?