Hi,
I have an ASP .net page that contains a label and a NEXT button.
I want to display in the label, array values one at a time as the next button is pushed. This is the foundation that I will build further functionality on. This seems so simple, but I cant figure out how to do it I am new to asp .net. Im trying to increment a counter to go through the array, but the counter keeps getting reset to zero. I hope someone can help me. THANKS! Here is my code:
I have an ASP .net page that contains a label and a NEXT button.
I want to display in the label, array values one at a time as the next button is pushed. This is the foundation that I will build further functionality on. This seems so simple, but I cant figure out how to do it I am new to asp .net. Im trying to increment a counter to go through the array, but the counter keeps getting reset to zero. I hope someone can help me. THANKS! Here is my code:
Visual Basic:
Public Class AssignRecTypePerms
Inherits System.Web.UI.Page
Dim ctr As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim SCArray(,) = CType(Session.Item("SessSCArray"), Array)
lblSchoolCode.Text = SCArray(1, 0)
ctr = 0
End If
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim SCArray(,) = CType(Session.Item("SessSCArray"), Array)
ctr = ctr + 1
lblSchoolCode.Text = SCArray(1, ctr)
End Sub
End Class
Last edited by a moderator: