473,836 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to preserve session value with client callback?


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 >

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.

Public Sub RaiseCallbackEv ent(ByVal eventArgument As String) _
Implements System.Web.UI.I CallbackEventHa ndler.RaiseCall backEvent
If eventArgument.L ength 0 Then
Session("flag") = "1"
End If

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

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s) Handles
Session("flag") = "0"
End Sub
Dec 10 '07 #1
0 1282

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

Similar topics

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 by lnk2_Click(). The others return to their original values initiated during their declaration. But the static variable's life doesn't end when the page is closed and it causes
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, callback script does not do anything and hangs. If I click another key which requires postback after that, I get following error: ----------- Failed to load viewstate. The control tree into which viewstate is being loaded must match the control...
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 different. I have this authentication object whose sliding expiration value in the cache is less than the session timeout value. I want to abandon the session once the authentication object is removed from the cache. I cannt keep both the session...
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 on my system. I would like to be able to access the session of the user that submitted the order, and clear their basket. I don't really want to store their session in the database just to facilitate this.
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 information will be lost. I've tried doing a Reponse.Redirect call back to my login page whenever I detected the Session is null, but I kept getting the exception saying "... Redirect not all in Page Callback".
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 this and are there any examples to review. Thank you -- Jerry
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 application working. However, when attempting to implement the solution, the AJAX calls weren't updating the screen like the examples were and seemed not to fire until after the long running process had completed. I found the only real...
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, setting the Session.Timeout property doesn't help me avoid errors (I can obviously set the value to a very high value, but that still doesn't completely solve the problem). Is there any way for me to avoid the Session timing out? Thanks. --...
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 from/to the server every x seconds, causing the timeout never reachs the 15'? I got an answer but it seems not to work: "if you are using cookie based sessions, client callbacks do not update the
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.