Solved

I need to display a timer for an examination on my web page. Using VB.NET.

Posted on 2004-09-29
4
167 Views
Last Modified: 2010-04-25
I need to display a timer for an examination on my web page. Using VB.NET.

Can this be done easily?

Kind Regards

PG

0
Comment
Question by:pgilfeather
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 14

Expert Comment

by:dfu23
ID: 12180470
I would suggest using javascript .... what do you need to do?

A countdown?

Or show the current time?
0
 

Author Comment

by:pgilfeather
ID: 12180535
I need a countdown.

I have two problems...I have never really used javascript and I need to respond to the event of the counter getting to zero.

If you could talk me through how to do this I would be very thankful as I have a very tight deadline.

Kind Regards

PG
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12180617
Ok, I've responding to this question here and in the VB.NET topic area ... take a look at my post over there ... it shows the general idea to start in Javascript
0
 
LVL 23

Accepted Solution

by:
Saqib Khan earned 500 total points
ID: 12183756
OK here is a Basic Example. Simply Copy Paste and save it as a HTML file to see it in Action.
once understood integerate it with your PAGE (by copying Counter() Function and calling it within BODY tag)

Good Luck.



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>

<script>
var Duration;
Duration = 60; // 1 hours(60 Minutes)

function Counter() {

      var frm = document.f1.t1
      
      if(Duration >= 0) {
            frm.value = Duration;
            Duration--;
            
            T = setTimeout("Counter()", 1000*60)
      } else {
          
            alert("Session Expired")
            // or you can redirect to a different page by placing this line  document.location = "page_name.html"
            return false
      }
}

</script>
</head>

<body onload="return Counter()">

<form method="POST" name="f1">
      <p><input type="text" name="t1" size="20"></p>
</form>

</body>

</html>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question