473,405 Members | 2,334 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,405 software developers and data experts.

Web Timers

I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?
Nov 17 '05 #1
4 1169
Girish,

You'll have to do that with client side javascript.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Girish Pal Singh" <gi*******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?

Nov 17 '05 #2
You could create a method that

1. Checks for the existence of a Session "TimeStarted" variable
a. If it doesn't exist, create it and place the Current Time in it
2. Checks the Current Time against the Session variable
3. If the interval of difference is greater than your alloted time, take
some action.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Girish Pal Singh" <gi*******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?

Nov 17 '05 #3
Forgot to mention. Of course, the method I described would be placed in
every Page that the user might visit, and execute in the Page_Load method.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Girish Pal Singh" <gi*******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?

Nov 17 '05 #4
I am not quite sure why would you want to post the data.
The data can be incomplete or user was not going to submit his data at all.

If you just want to prevent his session from an expiration then there is a
simple method.

1. Create transparent.gif image 1x1 pixel.
2. create SessionRefresh.aspx page which outputs back to the browser that
image.
3. On the page which might take more than 20 minutes to fill out ( or any
page you want )
put following code somewhere.

<img src="transparent.gif" width=1 height=1 name="sessionrefresh">
<script>
window.setInterval("document.images['sessionrefresh'].src=sessionrefresh.asp
x;", 10*1000*60 );
</script>

So basically JavaScript will request every 10 minutes the
sessionrefresh.aspx and thus preventing session from expiration.

Also note that cashing might be a problem but you can always add ?param=time
in javascript to the end of sessionrefreshh.aspx. To prevent cashing.
George.

"Girish Pal Singh" <gi*******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?

Nov 17 '05 #5

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

Similar topics

1
by: GDumencu | last post by:
I have a C# program that have to run all the time. For some reasons I cannot make it a service. This program has 3 timers and by time to time ( days or weeks) one of them stops. Some times, starts...
0
by: Dmitry Demchuk | last post by:
Hi everybody. Recently I ran into situation with System.Threading.Timer in my ASP.NET application. I reinstalled Windows on one of my servers and got timers stop firing events after while, they...
0
by: Cider123 | last post by:
I was originally using: System.Windows.Forms.Timer It started to lock my Window Service up, so I went to the next evolution: System.Threading.Timer All was good. I was using it to send...
3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
9
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
10
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have...
5
by: Michael C# | last post by:
Hi all, I set up a System.Timers.Time in my app. The code basically just updates the screen, but since the processing performed is so CPU-intensive, I wanted to make sure it gets updated...
1
by: | last post by:
Frustrated.. (I have seen other posts regarding this problem with no resolution..) I am using dotnet 1.1 with latest SP on a Win2KP box (actually 2 boxes), have even run the service on WinXP SP2...
1
by: Jonathan Woods | last post by:
Hi there, I have three methods these need to execute at every interval time. I would like to know which option is better? Option A) Three System.Timers.Timer objects these execute each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
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...

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.