Forcing PostBack programmitically

Discussion in 'ASP .Net' started by =?Utf-8?B?VGFicmV6?=, Jun 19, 2004.

  1. 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?=, Jun 19, 2004
    #1
    1. Advertising

  2. 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?Sm9lLkRhdHRpbG8=?=, Jun 19, 2004
    #2
    1. Advertising

  3. 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
    =?Utf-8?B?VGFicmV6?=, Jun 21, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    0
    Views:
    394
    Earl Teigrob
    Aug 11, 2003
  2. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,893
    =?Utf-8?B?VGFicmV6?=
    Jun 21, 2004
  3. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    340
    =?Utf-8?B?VGFicmV6?=
    Jun 19, 2004
  4. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    347
    =?Utf-8?B?VGFicmV6?=
    Jun 19, 2004
  5. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    389
    Alvin Bruney [MVP]
    Jul 23, 2004
Loading...

Share This Page