473,322 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how to preserve session value with client callback?

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.RaiseCallbackE vent
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
Dec 10 '07 #1
0 1252

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: hb | last post by:
Hi, I need to declare a variable who's value can be preserve through the same ASP.Net page. I tried the following code, only the static variable s2 keeps its value=22 after lnk1_Click followed...
3
by: Nahrin | last post by:
I implimented ASP.NET 2.0 Client callback script (ICallbackEventHandler) to get the result back from server without postback the page. Problem is when seesion expires or authentication times out,...
0
by: 'Mani | last post by:
Hi All, I need to abandon a different session and want to know how to do this. Session.Abandon() will abndon only the current session associated with the current request. But, my necessity is...
4
by: Nick Gilbert | last post by:
Hi, Is it possible to access the Session of an arbitary user from an aspx page? On an e-commerce site, I am notified of payment success via a callback from the payment server to an ASPX page...
20
by: Simon Says | last post by:
Hi, I've a login page in which after authenticating it via the Oracle DB, I will stored the user information into the Session. However, when the Session timeout occurs, all of the user...
4
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have seen several articles about this subject but I was wondering with ajax is this easer. The articles mentioned client callback and the onbeforeunload event of the browser. Can AJAX be used for...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
4
by: Nathan Sokalski | last post by:
I have a page that uses Session variables when generating the SQL statements used to submit and retrieve data from a database. However, because I don't know how long the user will be on the page,...
0
by: Bob | last post by:
Hi, i posted a few days ago the following problem: how to close a session after timeout is reached (let's say 15') when the user stops any activity on a page with client callback, which sent...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.