Hello, I have a website that does calculations. I have a textbox that shows the results. I also have a button, and when I click this button I want it to add the results from the textbox into the array. I then have another button and I want to print the items that I have saved to the array on the screen. This is what I have and it is not working:
<script runat="server"> Dim MyArray(9) As String Dim i As Integer Protected Sub storedataButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) For i = 0 To 9 MyArray(i) = resultTextBox.Text Next i End Sub Protected Sub printdataButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) For i = 0 To 9 Response.Write("Result " & i & " is" & " " & MyArray(i) + "<br />") Next i End Sub </script>
Can somebody tell me what I am doing wrong, please? I am still kind of new to all of programming. Maybe somebody can give me a better idea of how I can do this???