How can I set the browser to refresh automatically without losing viewstate

Discussion in 'ASP .Net' started by john, Jan 29, 2004.

  1. john

    john Guest

    From my code behind file, I can put a line like this in order to make
    the page automatically refresh every minute:

    Response.AppendHeader("Refresh", 60);

    But the viewstate of the controls is lost when I do this (as opposed
    to when the page posts back when I click on a button on the page, in
    which case the viewstate is preserved). Is there another way to do an
    automatic refresh?

    thanks in advance.
     
    john, Jan 29, 2004
    #1
    1. Advertising

  2. john

    Curt_C [MVP] Guest

    use a javascript client-side time to do a form.submit() over 60 seconds.


    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "john" <> wrote in message
    news:...
    > From my code behind file, I can put a line like this in order to make
    > the page automatically refresh every minute:
    >
    > Response.AppendHeader("Refresh", 60);
    >
    > But the viewstate of the controls is lost when I do this (as opposed
    > to when the page posts back when I click on a button on the page, in
    > which case the viewstate is preserved). Is there another way to do an
    > automatic refresh?
    >
    > thanks in advance.
     
    Curt_C [MVP], Jan 29, 2004
    #2
    1. Advertising

  3. what about a META refresh tag

    jayson
     
    =?Utf-8?B?SmF5c29u?=, Jan 29, 2004
    #3
  4. john

    john Guest

    Can you please give me an example how to do this? I am new at
    javascript. I have tried putting the following function calls in
    javascript for my page and they all cause exceptions (with the form
    object being undefined or null):

    this.submit();
    form.submit();
    document.form.submit();
    document.forms[0].submit();
    document.theform.submit();
    document.myform.submit();

    thanks


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message news:<>...
    > use a javascript client-side time to do a form.submit() over 60 seconds.
    >
    >
     
    john, Jan 30, 2004
    #4
  5. john

    Curt_C [MVP] Guest

    I'd suggest a jscript group but.....something like this perhaps

    yourFormname is the name in the <FORM...> tag
    <SCRIPT LANGUAGE="JavaScript">
    setTimeout(yourFormname.submit(),6000);
    </SCRIPT>
    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "john" <> wrote in message
    news:...
    > Can you please give me an example how to do this? I am new at
    > javascript. I have tried putting the following function calls in
    > javascript for my page and they all cause exceptions (with the form
    > object being undefined or null):
    >
    > this.submit();
    > form.submit();
    > document.form.submit();
    > document.forms[0].submit();
    > document.theform.submit();
    > document.myform.submit();
    >
    > thanks
    >
    >
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message

    news:<>...
    > > use a javascript client-side time to do a form.submit() over 60 seconds.
    > >
    > >
     
    Curt_C [MVP], Jan 30, 2004
    #5
    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. Pascal Schmidt-Volkmar

    how to refresh browser automatically

    Pascal Schmidt-Volkmar, Apr 13, 2004, in forum: HTML
    Replies:
    11
    Views:
    17,167
    Andrew Urquhart
    Apr 14, 2004
  2. James Radke

    Datagrid question! losing a column on page refresh... why?

    James Radke, Oct 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    199
    Jacob Yang [MSFT]
    Oct 29, 2003
  3. Pkenty
    Replies:
    0
    Views:
    433
    Pkenty
    May 28, 2004
  4. David Mathog
    Replies:
    9
    Views:
    603
    Ian Collins
    May 26, 2012
  5. Jason C
    Replies:
    4
    Views:
    705
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page