Forcing PostBack programmitically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm doing an online examination page. After the alloted time of the exam the page should be posted back. I've used System.Timers namespace for timekeeping. Please help me post back the form in 'Elapsed event' of the timer object.I m using a combi. of ASP.net with VB.net
 
hi,
you're going to have to use the the setTimeout function in javascript :

window.setTimeout(expression/function, milliseconds);

Since anything that you have done with system.timers only runs on the server, all of the posting time tracking needs to be done on the client side.

www.devguru.com has a good javascript reference for setTimeout .

when the timer expires just call __DoPostback and the page should be posted back.

- joe
 
Well thanx for the elagant answer, it works when I provide a static time period in the setTimeOut function. But now consider this I have different test with different exam duration in the database. Supposing that I retrieve the test-type and its time duration and attach it to the query string of the questionpaper.aspx url. Now how should I retrieve it on client side with javascript. I've tried it in the following manner but it does not seem to work.

<body onload="return Window_Load('<%=request("ETime")%>'))" background=images/regbg.gif >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top