Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Forcing PostBack programmitically (http://www.velocityreviews.com/forums/t80896-forcing-postback-programmitically.html)

=?Utf-8?B?VGFicmV6?= 06-19-2004 10:12 AM

Forcing PostBack programmitically
 
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

=?Utf-8?B?Sm9lLkRhdHRpbG8=?= 06-19-2004 02:27 PM

RE: Forcing PostBack programmitically
 
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

"Tabrez" wrote:

> 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


=?Utf-8?B?VGFicmV6?= 06-21-2004 08:51 AM

RE: Forcing PostBack programmitically
 
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 >


"Joe.Dattilo" wrote:

> 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
>
> "Tabrez" wrote:
>
> > 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



All times are GMT. The time now is 04:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.