<input type="hidden" id="timeAllocated" name="timeAllocated" value="30" runat="server" />
if ( !IsPostBack ) timeAllocated.Value = value-from-database.ToString();
<script language="JavaScript"> <!-- function window::onload() { var timeAlloted = 30; if ( document.getElementById('timeAllocated').value.length > 0 ) timeAlloted = parseFloat(document.getElementById('timeAllocated').value); else document.getElementById('timeAllocated').value = timeAlloted; document.getElementById('timerDisplaySpan').innerHTML = '<b>Time Remaining: ' + timeAlloted + " Minutes.</b>"; // 1000 = 1 second... window.setInterval('decrementTimer()', 60000); } function decrementTimer() { var timeAlloted = parseFloat(document.getElementById('timeAllocated').value); timeAllote-; document.getElementById('timeAllocated').value = timeAlloted; document.getElementById('timerDisplaySpan').innerHTML = '<b>Time Remaining: ' + timeAlloted + " Minutes.</b>"; } // -->; </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)