count down

G

Guest

Hi all,

I need som advice. I want to display a textbox that displays a countdown
from say 90 minutes is hh:mm:ss format. I also want it to be displayed
consistently on every page of my system as long as the user is in a session
(ie. user session is 90 mins). The problem I think is that the countdown
tends to restart itself everytime the user refreshes the page, or re-loads
the page ie. moving from one page to another.

How do I do this. Should I use a user control to display the countdown timer?

Also is it possible to use the TIMER control to write the countdown ?

TIA
Andrew
 
E

Eliyahu Goldin

Andrew,

You need to use a client-side timer. Look at javascript function
window.setInterval(...). To solve problem of restarting the timer every time
when the user moves to another page, consider using iframes. Put the textbox
with the countdown on the top level window and open other pages in a iframe.
In this way the textbox won't be affected by navigating between the pages.

Eliyahu
 
G

Guest

Thanks for your reply. I have created a frameset which links to a "header"
(top)and "main" (bottom) aspx files.

I have a checkbox control and a label control in the header frame which I
want to access in the main frame. If chkMarked = true, store a value in the
db. The label control displays the question number that is generated in the
main frame.

How can I access that checkbox and label control ? The db code is in the
main frame. Also as each page in the main frame is Page.IsPostBack, how do I
refresh the controls in the header frame ?

TIA.
Andrew.
 
E

Eliyahu Goldin

I always use iframes and don't know much about frames. For an iframe, parent
property of the window object gives you a reference to the top-level window.
You can refer to the elements in the parent windows as
parent.document.getElementById("chkMarked"). You can call
parent.myForm.submit() to initiate a postback.

To get more information on using frames, as opposed to iframes, start a
separate thread.

Eliyahu
 
G

Guest

Thanks.

Eliyahu Goldin said:
I always use iframes and don't know much about frames. For an iframe, parent
property of the window object gives you a reference to the top-level window.
You can refer to the elements in the parent windows as
parent.document.getElementById("chkMarked"). You can call
parent.myForm.submit() to initiate a postback.

To get more information on using frames, as opposed to iframes, start a
separate thread.

Eliyahu
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top