Hello All, Thanks in advance for any help,
I am attempting to create an Array for a site I am building, the code I am including is purely to test the Array.
I am attempting to use Button1 to put the name and number of txtName and txtNum into Array slot 0,0 and 0,1. The Button2 does the same thing for Array slot 1,0 and 1,1. That part seems to work good but the part where I attempt to print the array slots to txtShow, nothing happens. I am assuming its something to do with the difference between vb.net and asp.net, any ideas?
I am attempting to create an Array for a site I am building, the code I am including is purely to test the Array.
VB.NET:
Partial Class _Default
Inherits System.Web.UI.Page
Dim strName, strNumber As String
Dim Info(0 To 1, 0 To 1) As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Info(0, 0) = txtName.Text
Info(0, 1) = txtNumber.Text
txtName.Text = " "
txtNumber.Text = " "
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Info(1, 0) = txtName.Text
Info(1, 1) = txtNumber.Text
txtName.Text = " "
txtNumber.Text = " "
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
txtShow.Text = Info(0, 0) & Info(0, 1)
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Try
strName = Info(1, 0) & Info(1, 1)
txtShow.Text = strName
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
End Class
I am attempting to use Button1 to put the name and number of txtName and txtNum into Array slot 0,0 and 0,1. The Button2 does the same thing for Array slot 1,0 and 1,1. That part seems to work good but the part where I attempt to print the array slots to txtShow, nothing happens. I am assuming its something to do with the difference between vb.net and asp.net, any ideas?