473,753 Members | 6,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3694

"Karen" <ba************ @yahoo.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
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.goo gle.com...
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.a i_l.com> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...
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.goo gle.com...
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.a sp?blah="+escap e(new
Date()));

have updatesession.a sp 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.goo gle.com...
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....reme mber my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbe llremovethis.ne t> wrote in message news:<eS******* *******@tk2msft ngp13.phx.gbl>. ..
on the client using setinterval:

var img=new Image("http://myserver/updatesession.a sp?blah="+escap e(new
Date()));

have updatesession.a sp 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.goo gle.com...
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...we ll 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.a i_l.com> wrote in message news:<ez******* *******@TK2MSFT NGP11.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.a i_l.com> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...
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.goo gle.com...
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.a sp";
var iCount=0;
var tOut;

function doUpdate(){
iCount++;
var img=new Image();
img.src=imgURL+ "?blah="+escape (new Date())
img=null;
document.getEle mentById("dMsg" ).innerHTML="Up dated: "+iCount;
tOut=window.set Timeout("doUpda te()",2000);
}
</script>
</HEAD>

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

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

<%

session("your_n ame")=session(" your_name")+1
response.redire ct "tiny.gif"

%>

OK?

Tim

"Karen" <ba************ @yahoo.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
Sorry Tim i don't see how i can accomplish this using with your
example....reme mber my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbe llremovethis.ne t> wrote in message

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

var img=new Image("http://myserver/updatesession.a sp?blah="+escap e(new
Date()));

have updatesession.a sp 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.goo gle.com...
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******@pacbe llremovethis.ne t> wrote in message news:<#d******* *******@TK2MSFT NGP11.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.a sp";
var iCount=0;
var tOut;

function doUpdate(){
iCount++;
var img=new Image();
img.src=imgURL+ "?blah="+escape (new Date())
img=null;
document.getEle mentById("dMsg" ).innerHTML="Up dated: "+iCount;
tOut=window.set Timeout("doUpda te()",2000);
}
</script>
</HEAD>

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

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

<%

session("your_n ame")=session(" your_name")+1
response.redire ct "tiny.gif"

%>

OK?

Tim

"Karen" <ba************ @yahoo.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
Sorry Tim i don't see how i can accomplish this using with your
example....reme mber my session variable is updated on the server
so....can you please explain a little bit more?
"Tim Williams" <sa******@pacbe llremovethis.ne t> wrote in message

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

var img=new Image("http://myserver/updatesession.a sp?blah="+escap e(new
Date()));

have updatesession.a sp 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.goo gle.com...
> 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
2993
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 their web pages. Let's say they both create the session variable $_SESSION. Each uses yo for a different purpose. Now we have a user accessing address.com. He goes to Bill's site and his session his started with the $_SESSION created.
4
1659
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 should I use a session variable and when should I just declare it like normal? Thanks in advance!
10
3439
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 database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
3
3212
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 the user perform operation on this page (postback navigation based). I also need to clean up the session data when the user leave the page (by a anyway). My question is about the Unload event, is it safe to use the unload
14
2194
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 and summaries are done there. In order for all of the values to appear on the last page, the user has to view each page that has a session variable to be passed to the last page. The only way I can think of to bypass the necessity of the user...
3
1315
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 session variables in a Button_Click event which determines how the page is supposed to appear in the PostBack, so of course it fails. Where should I put my code so that the session variables are re-set before the PostBack?
2
1761
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 variables and 5 arrays by 1000 elements 50 characters long each. Let say having 300 users using those pages at the same time. Server is not the fastest one, just CPU 2.40GHz. So question is as a user am I going to feel a difference in speed...
2
1462
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. If I read in user input from a web form, sanitize the input to make sure there isn't any injected data, and then store the sanitized input in a session variable, is there any way for that session variable to be modified by the client afterwards? I...
1
1300
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. Session("mysessionvar")). Is that the only way to use session state, or there are other ways?
0
8896
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,...
0
9653
Oralloy
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...
1
9421
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,...
0
9333
tracyyun
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...
0
8328
agi2029
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...
1
6869
isladogs
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...
0
4771
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...
2
2872
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2284
bsmnconsultancy
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.