Which event is appropriate....

Discussion in 'ASP .Net' started by Nelson, Nov 8, 2004.

  1. Nelson

    Nelson Guest

    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" <> wrote in message
    news:...
    > 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]" <> wrote in message
    > news:#...
    > > 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" <> wrote in message
    > > news:...
    > > > 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]" <> wrote in message
    > > > news:#...
    > > >> 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" <> wrote in message
    > > >> news:%23%...
    > > >> > 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
    > > >> >

    >
     
    Nelson, Nov 8, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    > news:...
    > > 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]" <> wrote in message
    > > news:#...
    > > > 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" <> wrote in message
    > > > news:...
    > > > > 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]" <> wrote in message
    > > > > news:#...
    > > > >> 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" <> wrote in message
    > > > >> news:%23%...
    > > > >> > 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
    > > > >> >

    > >

    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Nov 8, 2004
    #2
    1. Advertising

  3. Nelson

    Nelson Guest

    "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" <> wrote
    in message news:D...
    > 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" <> wrote in message
    > > news:...
    > > > 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]" <> wrote in message
    > > > news:#...
    > > > > 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" <> wrote in message
    > > > > news:...
    > > > > > 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]" <> wrote in message
    > > > > > news:#...
    > > > > >> 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" <> wrote in message
    > > > > >> news:%23%...
    > > > > >> > 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
    > > > > >> >
    > > >

    > >
    > >
    > >
     
    Nelson, Nov 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. annunaki
    Replies:
    0
    Views:
    343
    annunaki
    May 25, 2005
  2. Replies:
    1
    Views:
    326
    Grumble
    Jan 5, 2005
  3. pbd22
    Replies:
    1
    Views:
    1,787
    Mr. Arnold
    Mar 21, 2009
  4. Greg Dharma
    Replies:
    6
    Views:
    371
    Jorgen Grahn
    Jun 14, 2009
  5. someone
    Replies:
    45
    Views:
    730
    Chris Angelico
    Apr 15, 2013
Loading...

Share This Page