Solved

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

Posted on 2004-09-29
4
164 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
  • 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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