how to preserve session value with client callback?

D

David

Hi,

Every two seconds, the client callback starts sending a value to the server
(via javascript). That value can be empty or not. The session variable
"flag" gets the value "1" if the value is not empty (eventArgument length >
0).

My problem is: once session("flag")="1" , i want to keep that value till the
user leaves the page, even if the next value sent is empty.. But with this
code, the value "1" of session("flag) remains only till the next value is
empty. This page is never postbacked, so the initial value in Page_Load is
set only when the page is loaded.

Thanks
David


Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
If eventArgument.Length > 0 Then
Session("flag") = "1"
...
End If

If Session("flag") = "1" Then
...
Else
...
End If
End Sub

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Session("flag") = "0"
....
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top