473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which event is appropriate....

Here is the discussion that is already discussed that I am looking for.
After visiting the link below I am getting the following code.
My question is in which client side script event I can set the value of x =
10. Setting x = 10 in the onmousemove may be a performance issue.
Thank you very much for your advice.

After certain seconds. Triggers the alert message
<HTML><HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
var x = 10
var y = 1
function startClock(){
x = x-y
document.frm.clock.value = x
setTimeout("startClock()", 1000)
//if(x==0){
//alert("BOOM");
//x=10;
//Redirect the user to login page since the session times out
}
}
//--></SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onLoad="startClock()">
This page will explode in
<FORM NAME="frm">
<INPUT TYPE="TEXT" NAME="clock" SIZE=4 >
</FORM>
seconds...
</BODY></HTML>

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
The event would be the TimeOut Interval triggering the function that
setTimeOut refers to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:#w**************@TK2MSFTNGP11.phx.gbl...
The browser will keep track of that for you.
All you need is one client side event to fire once the trigger time has
elapsed and you want to warn the user.
You can name the event anything you want.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Benjamin" <Be********@hotmail.com> wrote in message
news:ua*************@tk2msftngp13.phx.gbl...
Thanks for your answers.

Now I understand I have to use setTimeout to achieve my goal.

The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really
helpful.

Which client side event I should use to keep track the user is still using the website.

Thanks,

Benjamin

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:#l*************@TK2MSFTNGP11.phx.gbl...
> You could try using the javascript setTimeout function set to 20 minutes> (the default session timeout period) and then set the
> document.location.href='login.aspx' via client side code.
> Here's an example of using the javascript setTimeout function:
> http://www.crowes.f9.co.uk/Javascript/timer.htm
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
>
> "Benjamin Smith" <Be********@hotmail.com> wrote in message
> news:%2******************@TK2MSFTNGP09.phx.gbl...
> > When the session times out, I would like to navigate to the login page.> > Currently when the session times out, the displayed screen remains
visible
> > on the screen however when the user clicks on the screen will take to the
> > login page.
> >
> > How to do that?
> >
> > Benjamin
> >

Nov 18 '05 #1
2 1300
The page being active or not is based on session value on the server. A page
timing out should coincide with that value, which means activity on the page
does nothing.

I assume, however, you are trying to auto log out a person who leaves a page
open. If so, you realistically have to test both mouse movement and keyboard
input. Yes, this will be a bit heavy, but not really bad, as it is all client
side. It is fairly easy to test the impact of this activity, by setting up a
do nothing JavaScript on both events.

In most cases, testing for key clicks or mouse clicks is probably enough.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Nelson" wrote:
Here is the discussion that is already discussed that I am looking for.
After visiting the link below I am getting the following code.
My question is in which client side script event I can set the value of x =
10. Setting x = 10 in the onmousemove may be a performance issue.
Thank you very much for your advice.

After certain seconds. Triggers the alert message
<HTML><HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
var x = 10
var y = 1
function startClock(){
x = x-y
document.frm.clock.value = x
setTimeout("startClock()", 1000)
//if(x==0){
//alert("BOOM");
//x=10;
//Redirect the user to login page since the session times out
}
}
//--></SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onLoad="startClock()">
This page will explode in
<FORM NAME="frm">
<INPUT TYPE="TEXT" NAME="clock" SIZE=4 >
</FORM>
seconds...
</BODY></HTML>

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
The event would be the TimeOut Interval triggering the function that
setTimeOut refers to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:#w**************@TK2MSFTNGP11.phx.gbl...
The browser will keep track of that for you.
All you need is one client side event to fire once the trigger time has
elapsed and you want to warn the user.
You can name the event anything you want.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Benjamin" <Be********@hotmail.com> wrote in message
news:ua*************@tk2msftngp13.phx.gbl...
> Thanks for your answers.
>
> Now I understand I have to use setTimeout to achieve my goal.
>
> The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really
> helpful.
>
> Which client side event I should use to keep track the user is still

using
> the website.
>
> Thanks,
>
> Benjamin
>
>
>
> "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
> news:#l*************@TK2MSFTNGP11.phx.gbl...
>> You could try using the javascript setTimeout function set to 20

minutes
>> (the default session timeout period) and then set the
>> document.location.href='login.aspx' via client side code.
>> Here's an example of using the javascript setTimeout function:
>> http://www.crowes.f9.co.uk/Javascript/timer.htm
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "Benjamin Smith" <Be********@hotmail.com> wrote in message
>> news:%2******************@TK2MSFTNGP09.phx.gbl...
>> > When the session times out, I would like to navigate to the login

page.
>> > Currently when the session times out, the displayed screen remains
> visible
>> > on the screen however when the user clicks on the screen will take to > the
>> > login page.
>> >
>> > How to do that?
>> >
>> > Benjamin
>> >


Nov 18 '05 #2
"by setting up a do nothing JavaScript "
You are saying write an event handler for this event and do not write any
statement or is there any do nothig statements.
Thanks,
Nelson

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:DC**********************************@microsof t.com...
The page being active or not is based on session value on the server. A page timing out should coincide with that value, which means activity on the page does nothing.

I assume, however, you are trying to auto log out a person who leaves a page open. If so, you realistically have to test both mouse movement and keyboard input. Yes, this will be a bit heavy, but not really bad, as it is all client side. It is fairly easy to test the impact of this activity, by setting up a do nothing JavaScript on both events.

In most cases, testing for key clicks or mouse clicks is probably enough.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Nelson" wrote:
Here is the discussion that is already discussed that I am looking for.
After visiting the link below I am getting the following code.
My question is in which client side script event I can set the value of x = 10. Setting x = 10 in the onmousemove may be a performance issue.
Thank you very much for your advice.

After certain seconds. Triggers the alert message
<HTML><HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
var x = 10
var y = 1
function startClock(){
x = x-y
document.frm.clock.value = x
setTimeout("startClock()", 1000)
//if(x==0){
//alert("BOOM");
//x=10;
//Redirect the user to login page since the session times out
}
}
//--></SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onLoad="startClock()">
This page will explode in
<FORM NAME="frm">
<INPUT TYPE="TEXT" NAME="clock" SIZE=4 >
</FORM>
seconds...
</BODY></HTML>

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
The event would be the TimeOut Interval triggering the function that
setTimeOut refers to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:#w**************@TK2MSFTNGP11.phx.gbl...
> The browser will keep track of that for you.
> All you need is one client side event to fire once the trigger time has > elapsed and you want to warn the user.
> You can name the event anything you want.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
>
> "Benjamin" <Be********@hotmail.com> wrote in message
> news:ua*************@tk2msftngp13.phx.gbl...
> > Thanks for your answers.
> >
> > Now I understand I have to use setTimeout to achieve my goal.
> >
> > The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really
> > helpful.
> >
> > Which client side event I should use to keep track the user is still using
> > the website.
> >
> > Thanks,
> >
> > Benjamin
> >
> >
> >
> > "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
> > news:#l*************@TK2MSFTNGP11.phx.gbl...
> >> You could try using the javascript setTimeout function set to 20
minutes
> >> (the default session timeout period) and then set the
> >> document.location.href='login.aspx' via client side code.
> >> Here's an example of using the javascript setTimeout function:
> >> http://www.crowes.f9.co.uk/Javascript/timer.htm
> >>
> >> --
> >> I hope this helps,
> >> Steve C. Orr, MCSD, MVP
> >> http://Steve.Orr.net
> >>
> >>
> >> "Benjamin Smith" <Be********@hotmail.com> wrote in message
> >> news:%2******************@TK2MSFTNGP09.phx.gbl...
> >> > When the session times out, I would like to navigate to the login page.
> >> > Currently when the session times out, the displayed screen remains > > visible
> >> > on the screen however when the user clicks on the screen will
take to
> > the
> >> > login page.
> >> >
> >> > How to do that?
> >> >
> >> > Benjamin
> >> >


Nov 18 '05 #3

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

Similar topics

2
1590
by: M Shafaat | last post by:
Hi, I want to develop an application with menus. I want to make only one event handler method which handles a whole group of menu items by firstly identifying which MenuItem sends the click event...
7
2134
by: Grahmmer | last post by:
I have a few timers that are added to a form at runtime. I can handle the event fine, but I cannot identify which timer fired. Is there a way to do this? Timer Creation: -------------...
6
6669
by: John Smith | last post by:
How can I find out which control performed PostBack? I have put this code inside my Page_Load event: Response.Write(Page.Request.Params.Get("__EVENTTARGET")) but it doesn't write to response...
4
4659
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
5
4398
by: kmcmanus | last post by:
I have just started to write a few business classes that are largely made up of properties (getters and setters). For each setter I want to fire a changed event - each event will have a unique...
5
1913
by: Yossi | last post by:
I have a grid view with several text columns and 2 button columns. How do I tell which button on which row was clicked?
15
3592
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
4
1670
by: yumbelie | last post by:
Hi, I've got an issue where I've created a prototype that contains 2 methods, and a few private variables. The first method simply registers the second method to be an event handler for the...
15
4191
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
0
7202
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
7280
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,...
0
7330
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...
1
6991
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...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
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...

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.