Hi Terry,
I changed your program, and that shows it even more, was for me it was
amazing. The system timer goes on and set the referenced object in the
session (and that can of course not in the viewstate).
I did not really look what was the problem when I wrote the first message,
however I saw something pointing on stateless and the session.
Thanks for letting me know, I did not know this.
However, this even shows more the truth from my other messages in this
thread.
Cor
\\\ beside the button it needs now 2 labels.
Private WithEvents timer1 As New System.Timers.Timer
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
If Page.IsPostBack Then
Label1.Text = Session.Item("C").ToString
Label2.Text = ViewState("C").ToString
Else
timer1.Interval = 1000
timer1.Start()
Session.Add("C", 1)
ViewState.Add("C", 1)
End If
End Sub
Private Sub Timer1_Elapsed(ByVal sender As System.Object, _
ByVal e As System.Timers.ElapsedEventArgs) Handles timer1.Elapsed
Session.Item("C") = CInt(Viewstate("C")) + 1
Viewstate.Item("C") = CInt(Viewstate("C")) + 1
End Sub
///