Please help,
I am having trouble using an aspx page as a "loop". I have 2 session variables "LAST" and "TOTAL" such that "LAST" holds the last page load count (starting at 0) and "TOTAL" holds the total number of loops.
The user enters the "TOTAL" value and the page is continually redirected to until "LAST" >= "TOTAL". The problem is that after 3 loops, the session variables lose their value. Below is an example of the code on the page being looped:
Private total As String
Private last As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Me.total = Session("TOTAL"
Me.last = Session("LAST"
If (last < total) Then
Label1.Text = last
Label2.Text = total
Else
Response.Redirect("finished.aspx"
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Session("LAST"
= Session("LAST"
+ 1
Session("TOTAL"
= Me.total
Response.Redirect("ques.aspx"
End Sub
ques.aspx is the name of the asp net page being looped, after 3 the "finished.aspx" page is brought up. Please help. A big THANK YOU to anyone with ideas.
I am having trouble using an aspx page as a "loop". I have 2 session variables "LAST" and "TOTAL" such that "LAST" holds the last page load count (starting at 0) and "TOTAL" holds the total number of loops.
The user enters the "TOTAL" value and the page is continually redirected to until "LAST" >= "TOTAL". The problem is that after 3 loops, the session variables lose their value. Below is an example of the code on the page being looped:
Private total As String
Private last As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Me.total = Session("TOTAL"
Me.last = Session("LAST"
If (last < total) Then
Label1.Text = last
Label2.Text = total
Else
Response.Redirect("finished.aspx"
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Session("LAST"
Session("TOTAL"
Response.Redirect("ques.aspx"
End Sub
ques.aspx is the name of the asp net page being looped, after 3 the "finished.aspx" page is brought up. Please help. A big THANK YOU to anyone with ideas.