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 ASP.net with VB.net)
    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?VGFicmV6?=

    Teemu Keiski Guest

    You'd need to do timing at client. Causing postback is quite easy, just
    output a __doPostBack call that is called when timeout is elapsed. You'll
    get that done by using Page.GetPostBackEventReference method (it returns you
    the javascript call to cause a postback in behalf of given control), then
    just output the call and wrap it into js code on the client-side HTML to get
    called after time is elapsed. IIRC, js has setTimeout method or something
    similar. Unless js isn't robust enough, I think you'd need to use richer
    client stuff (maybe Flash or even applet)

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke



    "Tabrez" <> wrote in message
    news:...
    > 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 ASP.net with VB.net)
    Teemu Keiski, 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. I get an empty querystring ETime

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

    Note: I apologise for multiple postings, that was because whenever I posted I recieved "could not post" error message when in fact it had.
    "Teemu Keiski" wrote:

    > You'd need to do timing at client. Causing postback is quite easy, just
    > output a __doPostBack call that is called when timeout is elapsed. You'll
    > get that done by using Page.GetPostBackEventReference method (it returns you
    > the javascript call to cause a postback in behalf of given control), then
    > just output the call and wrap it into js code on the client-side HTML to get
    > called after time is elapsed. IIRC, js has setTimeout method or something
    > similar. Unless js isn't robust enough, I think you'd need to use richer
    > client stuff (maybe Flash or even applet)
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    > http://blogs.aspadvice.com/joteke
    >
    >
    >
    > "Tabrez" <> wrote in message
    > news:...
    > > 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 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:
    400
    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:
    0
    Views:
    352
    =?Utf-8?B?VGFicmV6?=
    Jun 19, 2004
  3. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    351
    =?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:
    2
    Views:
    398
    Alvin Bruney [MVP]
    Jul 23, 2004
  5. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

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

Share This Page