Click here to Skip to main content
15,891,136 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to get clientid of asp.net textbox Pin
Ashish Sehajpal8-Apr-08 22:14
Ashish Sehajpal8-Apr-08 22:14 
GeneralRe: How to get clientid of asp.net textbox Pin
Christian Graus9-Apr-08 0:26
protectorChristian Graus9-Apr-08 0:26 
QuestionQuiz Questions Pin
senthilsstil8-Apr-08 20:59
senthilsstil8-Apr-08 20:59 
GeneralRe: Quiz Questions Pin
Abhijit Jana8-Apr-08 21:14
professionalAbhijit Jana8-Apr-08 21:14 
GeneralRe: Quiz Questions Pin
senthilsstil8-Apr-08 21:19
senthilsstil8-Apr-08 21:19 
GeneralRe: Quiz Questions Pin
Abhijit Jana8-Apr-08 21:30
professionalAbhijit Jana8-Apr-08 21:30 
GeneralRe: Quiz Questions Pin
Christian Graus8-Apr-08 21:20
protectorChristian Graus8-Apr-08 21:20 
GeneralRe: Quiz Questions Pin
Ashish Sehajpal8-Apr-08 21:49
Ashish Sehajpal8-Apr-08 21:49 
use this javascript in head tag of page and call GETCOUNT() funtion in body onload event of page...
here, dshow and dhide are jsut CSS classes which sets the display:none|block;
right
and btnsub is the submit button which will be disabled if time is OFF...right
lblrslt is the asp:label which will show messages or time....


<script language="javascript" type="text/javascript">
var d = new Date();
var yy=d.getFullYear();
var mm=d.getMonth();
var dd=d.getDate();
var hh=d.getHours();
var min =d.getMinutes();
//var m=1;
var m=parseInt(document.getElementById("lbltottime").innerHTML);
min=min + m;
if(min>60)
{
hh++;
min=min-60;
}
dateFuture = new Date(yy,mm,dd,hh,min,00);
document.getElementById("lbltottime").innerHTML=document.getElementById("lbltottime").innerHTML+ ' Min';
function GetCount()
{
dateNow = new Date();
amount = dateFuture.getTime() - dateNow.getTime(); //calc milliseconds between dates
delete dateNow;
if(document.getElementById('btnsub').value!='Submit')
{
amount=-1;
}
if(amount < 0)
{
if(document.getElementById('btnsub').value=='Submit')
{
document.getElementById('lblyrtim').innerHTML="00";

document.getElementById('btntestcomp').className='dshow';
document.getElementById('btnsub').className='dhide';
document.getElementById('btnsub').disabled=true;
document.getElementById('lblrslt').innerHTML="Your Time Is Over";
}

}
else{
days=0;hours=0;mins=0;secs=0;out="";
amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs
days=Math.floor(amount/86400);//days
amount=amount%86400;

hours=Math.floor(amount/3600);//hours
amount=amount%3600;

mins=Math.floor(amount/60);//minutes
amount=amount%60;

secs=Math.floor(amount);//seconds

if(days != 0){out += days +" day"+((days!=1)?"s":"")+", ";}
if(days != 0 || hours != 0){out += hours +" hour"+((hours!=1)?"s":"")+", ";}
if(days != 0 || hours != 0 || mins != 0){out += mins+((mins!=1)?" m":"")+": ";}
out += secs +" s";
document.getElementById('lblyrtim').innerHTML=out;

setTimeout("GetCount()", 1000);
}

}
function callme()
{


window.clipboardData.clearData();
self.setTimeout("callme()", 10);
}

window.onload=function()
{
callme();
}

</script>



cheers !

Ashish Sehajpal

GeneralRe: Quiz Questions Pin
senthilsstil8-Apr-08 21:58
senthilsstil8-Apr-08 21:58 
GeneralOnLine Payment Pin
Member 46590018-Apr-08 20:52
Member 46590018-Apr-08 20:52 
GeneralRe: OnLine Payment Pin
N a v a n e e t h8-Apr-08 20:57
N a v a n e e t h8-Apr-08 20:57 
GeneralRe: OnLine Payment Pin
Ashish Sehajpal8-Apr-08 21:36
Ashish Sehajpal8-Apr-08 21:36 
Generalonline Payment Pin
Member 46590018-Apr-08 20:28
Member 46590018-Apr-08 20:28 
GeneralRe: online Payment Pin
N a v a n e e t h8-Apr-08 20:32
N a v a n e e t h8-Apr-08 20:32 
Generalautomatically change the question in the page after 10 seconds Pin
hepsy.i8-Apr-08 19:53
hepsy.i8-Apr-08 19:53 
GeneralRe: automatically change the question in the page after 10 seconds Pin
Christian Graus8-Apr-08 19:56
protectorChristian Graus8-Apr-08 19:56 
GeneralRe: automatically change the question in the page after 10 seconds Pin
N a v a n e e t h8-Apr-08 20:00
N a v a n e e t h8-Apr-08 20:00 
GeneralRe: automatically change the question in the page after 10 seconds Pin
Christian Graus8-Apr-08 20:04
protectorChristian Graus8-Apr-08 20:04 
GeneralRe: automatically change the question in the page after 10 seconds Pin
N a v a n e e t h8-Apr-08 20:16
N a v a n e e t h8-Apr-08 20:16 
GeneralRe: automatically change the question in the page after 10 seconds Pin
Soumini Ramakrishnan9-Apr-08 21:09
Soumini Ramakrishnan9-Apr-08 21:09 
Generalhelp Pin
strawberrysh8-Apr-08 19:38
strawberrysh8-Apr-08 19:38 
GeneralRe: help Pin
eyeseetee8-Apr-08 21:54
eyeseetee8-Apr-08 21:54 
Generalhelp Pin
strawberrysh8-Apr-08 19:38
strawberrysh8-Apr-08 19:38 
GeneralRe: help Pin
Christian Graus8-Apr-08 19:46
protectorChristian Graus8-Apr-08 19:46 
GeneralRe: help Pin
N a v a n e e t h8-Apr-08 19:52
N a v a n e e t h8-Apr-08 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.