473,320 Members | 1,804 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,320 software developers and data experts.

QUESTION ON SESSION VARIABLES

Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!
Jul 19 '05 #1
8 3677

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???


No. The only "something" that can update the session is the client. In the
simple world, anyway.

Ray at work
Jul 19 '05 #2
I neevr tried it tu update session variables (I have session variables with
passion) but calling an ASP page with an XMLHTTP call in JavaScript should
work (I never tried though).

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!

Jul 19 '05 #3
Whoa! Typos!

I never tried to update session variables (I hate session variables with
passion) but calling an ASP page from the client using JavaScript and the
XMLHTTP object should work (I never tried it).

That's better, sorry about that!

"Michel Thiffault" <mt***@h.ot_m.ai_l.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I neevr tried it tu update session variables (I have session variables with passion) but calling an ASP page with an XMLHTTP call in JavaScript should
work (I never tried though).

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!


Jul 19 '05 #4

on the client using setinterval:

var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
Date()));

have updatesession.asp do the update to the session variable and then
redirect to a 1x1 gif or something.
The querystring part will force the browser to always make the request
instead of using the cache.
Tim.

"Karen" <> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!

Jul 19 '05 #5
Sorry Tim i don't see how i can accomplish this using with your
example....remember my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbellremovethis.net> wrote in message news:<eS**************@tk2msftngp13.phx.gbl>...
on the client using setinterval:

var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
Date()));

have updatesession.asp do the update to the session variable and then
redirect to a 1x1 gif or something.
The querystring part will force the browser to always make the request
instead of using the cache.
Tim.

"Karen" <> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!

Jul 19 '05 #6
yeah that's better ...kidding...well thanks for your reply...i kinda
know what i should do but don't relay know how i can accomplish
it??...anyway...hoep someone will help me with it!!
"Michel Thiffault" <mt***@h.ot_m.ai_l.com> wrote in message news:<ez**************@TK2MSFTNGP11.phx.gbl>...
Whoa! Typos!

I never tried to update session variables (I hate session variables with
passion) but calling an ASP page from the client using JavaScript and the
XMLHTTP object should work (I never tried it).

That's better, sorry about that!

"Michel Thiffault" <mt***@h.ot_m.ai_l.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I neevr tried it tu update session variables (I have session variables

with
passion) but calling an ASP page with an XMLHTTP call in JavaScript should
work (I never tried though).

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!


Jul 19 '05 #7

Karen,

If you want to run code on the server from the client, you must make a
request. One way to do this is to submit a form - which you *don't* want to
do - an another is to make a reqest by creating an image and setting its src
attribute to an asp page. This asp page has access to the user's session,
so it can update the session variable before returning the image to the
client.

################### client
<HTML>
<HEAD>
<TITLE> Session Update </TITLE>

<script>
var imgURL="http://myserver/updatesession.asp";
var iCount=0;
var tOut;

function doUpdate(){
iCount++;
var img=new Image();
img.src=imgURL+"?blah="+escape(new Date())
img=null;
document.getElementById("dMsg").innerHTML="Updated : "+iCount;
tOut=window.setTimeout("doUpdate()",2000);
}
</script>
</HEAD>

<BODY onload="doUpdate();">
<div id='dMsg'></div>
</BODY>
</HTML>

################ server (updatesession.asp)

<%

session("your_name")=session("your_name")+1
response.redirect "tiny.gif"

%>

OK?

Tim

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Sorry Tim i don't see how i can accomplish this using with your
example....remember my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbellremovethis.net> wrote in message

news:<eS**************@tk2msftngp13.phx.gbl>...
on the client using setinterval:

var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
Date()));

have updatesession.asp do the update to the session variable and then
redirect to a 1x1 gif or something.
The querystring part will force the browser to always make the request
instead of using the cache.
Tim.

"Karen" <> wrote in message
news:a6**************************@posting.google.c om...
Hi there....
i got a quick one for you guys. i've this session variable that is
updated by calling a server method (i set this value when the user
hits a submit button in my form. The server method is called when i
load all my asp forms.). I'd like to be able to update this session
variable, without being forced to submit my form or refresh my form
(something that will call my server method each 2 min lets say,
without refreshing my page or submit)...is there anyway to do this???
Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6 !!

Your help is with this matter is higly appreciated!!

Jul 19 '05 #8
Ok Tim! let me try this and i'll let you know...thanks a lot!
"Tim Williams" <sa******@pacbellremovethis.net> wrote in message news:<#d**************@TK2MSFTNGP11.phx.gbl>...
Karen,

If you want to run code on the server from the client, you must make a
request. One way to do this is to submit a form - which you *don't* want to
do - an another is to make a reqest by creating an image and setting its src
attribute to an asp page. This asp page has access to the user's session,
so it can update the session variable before returning the image to the
client.

################### client
<HTML>
<HEAD>
<TITLE> Session Update </TITLE>

<script>
var imgURL="http://myserver/updatesession.asp";
var iCount=0;
var tOut;

function doUpdate(){
iCount++;
var img=new Image();
img.src=imgURL+"?blah="+escape(new Date())
img=null;
document.getElementById("dMsg").innerHTML="Updated : "+iCount;
tOut=window.setTimeout("doUpdate()",2000);
}
</script>
</HEAD>

<BODY onload="doUpdate();">
<div id='dMsg'></div>
</BODY>
</HTML>

################ server (updatesession.asp)

<%

session("your_name")=session("your_name")+1
response.redirect "tiny.gif"

%>

OK?

Tim

"Karen" <ba************@yahoo.com> wrote in message
news:a6**************************@posting.google.c om...
Sorry Tim i don't see how i can accomplish this using with your
example....remember my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbellremovethis.net> wrote in message

news:<eS**************@tk2msftngp13.phx.gbl>...
on the client using setinterval:

var img=new Image("http://myserver/updatesession.asp?blah="+escape(new
Date()));

have updatesession.asp do the update to the session variable and then
redirect to a 1x1 gif or something.
The querystring part will force the browser to always make the request
instead of using the cache.
Tim.

"Karen" <> wrote in message
news:a6**************************@posting.google.c om...
> Hi there....
> i got a quick one for you guys. i've this session variable that is
> updated by calling a server method (i set this value when the user
> hits a submit button in my form. The server method is called when i
> load all my asp forms.). I'd like to be able to update this session
> variable, without being forced to submit my form or refresh my form
> (something that will call my server method each 2 min lets say,
> without refreshing my page or submit)...is there anyway to do this???
> Maybe a remote scripting with the setinterval() method?? but i'm
> having trouble using this with XP and IE 6 !!
>
> Your help is with this matter is higly appreciated!!

Jul 19 '05 #9

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

Similar topics

9
by: Xizor | last post by:
Let's say I run a server. I have two people using the server. Bill and Joe. Bill is at address.com/bill and Joe is at address.com/joe. Let's say Joe and Bill are both using PHP with sessions on...
4
by: VB Programmer | last post by:
If I have a variable I want to share in my application what is the difference between just declaring a variable (Dim strMyVar as String) and using a session variable (Session("strMyVar"))? When...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
3
by: Gauthier Segay | last post by:
Hello, I've an application where all my pages implement a PAGE_CODE string property, this property is stored in HttpContext.Current.Items. In some page, I must persist data in session while...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
3
by: Phillip N Rounds | last post by:
In diagnosing a problem, I noted that a button_click event gets run only after the page Page_Load event of the post back. (VS 2003, ASPNET 1.1, C#) Can this be correct? I'm trying to set...
2
by: Michaelk | last post by:
Can somebody tell me how many Session variables would be considered exessive, and when they start really affect the server speed. For example on 20-30 asp pages I need to use about 200-300 session...
2
by: DLN | last post by:
Hello all, I apologize for the naivety of this question, but I'm wondering whether session variables can ever be modified (somehow) by a client without having to go through code that I write. ...
1
by: Britt | last post by:
Hi, I read that SessionState is on by default. I also read that if it's not required, it must be better off (because of resources) My question is: i don't use session variables (like e.g....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.