473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help me in completing this project

Hai every one i am developing a online exam for submitting to my university,
i am using Dotnet 2005 with framework 2.0 and backend as mysql 5.0
i want to update the time to database frequently with out disturbing the user and knowing to user so that once he closes the window and again logins answers he clicks has to be retrieved and time maintainence so please help in this case i have used following code to perform that in an another page

Expand|Select|Wrap|Line Numbers
  1. function start()
  2.            {
  3.  
  4.                   i++;
  5.                   timer = setTimeout("start()",1000);
  6.  
  7.                         if(i==11)
  8.              {
  9.                  // Updating the Radio Button value
  10.                  var sessionid = window.top.location.search.substring(0)
  11.                  var ind = sessionid.indexOf("&")
  12.                  if(ind==-1)
  13.                      ind=sessionid.length
  14.                      var mod = sessionid.substr(0,ind) 
  15.                      var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  16.                      xmlhttp.onreadystatechange=function() 
  17.                      {
  18.                           if (xmlhttp.readyState==4)
  19.                           {
  20.                                   //alert(xmlhttp.responseText)
  21.                           }
  22.  
  23.                      }
  24.                      var url = rev(window.top.location.toString());  
  25.                      var ind = url.indexOf("/");
  26.                      url= url.substr(ind+1);
  27.                      url= rev(url)+"/time.aspx";
  28.                      var timeelapsed=hh+ ":"+mm+":"+ ss;
  29.                      var timeleft=hhLeft+":"+mmLeft+":"+ ssLeft;   
  30.                      url =url+"?timeleft="+timeleft+"&timeelapsed="+timeelapsed ;
  31.                      xmlhttp.open("GET",url,true);
  32.                      xmlhttp.send(null);    
  33.                              //document.forms("Form1").submit()
  34.                              // LoadTime()
  35.                              i=0;
  36.                   }     
  37.                   ss = parseInt(ss) + 1;
  38.                   if(parseInt(ss)>59)
  39.                   {
  40.                          ss = "00";
  41.                          mm=parseInt(mm) + 1;
  42.                   }
  43.                   if(parseInt(mm)>59)
  44.                   {
  45.                          mm ="00";
  46.                          hh =parseInt(hh) + 1;
  47.                   }
  48.                   ssLeft = parseInt(ssLeft) - 1;
  49.                   if(parseInt(ssLeft)<0)
  50.                   {  
  51.                        if(parseInt(mmLeft)>0)
  52.                        {
  53.                             ssLeft = 59;
  54.                             mmLeft=parseInt(mmLeft) -1
  55.                        }
  56.                   }
  57.                   if(parseInt(mmLeft)<=0 && parseInt(ssLeft)<=0)
  58.                   {
  59.                        if(parseInt(hhLeft)>0 )
  60.                        {
  61.                                mmLeft =  60;
  62.                                hhLeft=eval(hhLeft) - 1
  63.                        }
  64.                   } 
  65.  
  66.  
  67.                   // Updating The Status        
  68.                   curtm.innerText = hh + " : "+ mm + " : "+ss;
  69.                   remtm.innerText = hhLeft +" : "+ mmLeft + " : "+ssLeft;
  70.                   document.all("HH").value=hh
  71.                   document.all("MM").value=mm
  72.                   document.all("SS").value=ss
  73.                   document.all("HHLeft").value=hhLeft
  74.                   document.all("MMLeft").value=mmLeft
  75.                   document.all("SSLeft").value=ssLeft
  76.                    if((parseInt(hhLeft)<=0) && (parseInt(mmLeft)<=0) && (parseInt(ssLeft)<=0) || (parseInt(hh)<0) && (parseInt(mm)<0) && (parseInt(ssLeft)<0)) 
  77.                   {
  78.                        clearTimeout(timer)
  79.                        alert("finish");
  80. //                       document.forms("form1").action="main.aspx?key=close"
  81. //                       document.forms("form1").submit() 
  82. //                       document.forms("Form1").action="Default.aspx?key=close"
  83. //                       document.forms("Form1").submit() 
  84.                   } 
  85.              }
  86.  


but it is not working the code in time.aspx does'nt excetues please any one help me .
Sep 19 '08 #1
1 1161
iam_clint
1,208 Expert 1GB
I would first note to try to send "" instead of null this has caused issues before.
Sep 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rattanan Nantiyakul | last post by:
Subject: A Student Needs Your Help with Research Dear All, I am pursing a Master’s degree from Monash University. Currently, I am in the final stage of my program. I am doing a research...
0
by: rattanan | last post by:
Dear All, I am pursing a Master's degree from Monash University. Currently, I am in the final stage of my program. I am doing a research project examining the impact of Microsoft's Reporting...
0
by: rattanan | last post by:
Subject: A Student Needs Your Help with Research Dear All, I am pursing a Master’s degree from Monash University. Currently, I am in the final stage of my program. I am doing a research...
7
by: Wayne Gibson | last post by:
Hi, I need some advise with a java applet. I am nearing completing of the project and am getting a little concerned how long it is taking for the applet to load. I have developed the java applet...
3
by: chopperuk | last post by:
Hi just a quick one, for a project I am completing, I need to bascially, have a form on a web site (where a user types in a question), this then, needs to question a chat bot (programE - ALICE), and...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... There are a few questions wrapped up in this, but the main one is that the WebService.MyMethodAsync() methods that are automatically generated in the client code by VS 2005 don't seem to...
4
by: ShutterMan | last post by:
I have a JSON object as below (data is from SQL Server Northwind Database). But doing an eval on it returns an error "unterminated string constant" or such. Can someone help me pinpoint the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.