Page Refresh

Last post 07-06-2009 5:23 AM by booler. 3 replies.

Sort Posts:

  • Page Refresh

    07-06-2009, 3:48 AM
    • Member
      8 point Member
    • jayakumar007
    • Member since 07-01-2008, 10:45 AM
    • Posts 49

    Hi i am using META Tag to Refresh my aspx page for every 10 seconds, I am using Gridview in the page whose values are updated for every 10 seconds,


    I am loading the grid view under

    if(!page.isPostBack)

    {
         // Function for binding gridview
    }


    but after every ten seconds the isPostBack returns false only..

    how to do postback using Javascript for every 10 seconds


    Please help

  • Re: Page Refresh

    07-06-2009, 4:46 AM
    • Member
      7 point Member
    • tratto
    • Member since 05-26-2009, 12:43 PM
    • Spb, Russia
    • Posts 41

    Hello,

    Maybe this wiil help http://www.astahost.com/info.php/Cnet-Web-Timer-Control-Tutorial_t6605.html

    With best regards,
    Stas
  • Re: Page Refresh

    07-06-2009, 5:00 AM
    • All-Star
      20,530 point All-Star
    • venkatu2005
    • Member since 07-01-2008, 6:48 AM
    • Posts 4,487


    jayakumar007:

    but after every ten seconds the isPostBack returns false only..

    how to do postback using Javascript for every 10 seconds

    Ispostback occurs only when the page_loads on first time suppose if you want to access the some code on each postback write it on else part ie: when the postback is false .


    check this

    http://www.quackit.com/javascript/javascript_refresh_page.cfm

    I have Changed My Blog from (http://venkat-dotnetsamples.blogspot.com) to (http://venkat-dotnetsnippets.blogspot.com)

    Regards,
    Venkatesan.M

    Please Mark as Answered If its helpful and Un-Mark as Answered if it not help u.
  • Re: Page Refresh

    07-06-2009, 5:23 AM
    Answer
    • Star
      14,342 point Star
    • booler
    • Member since 08-15-2005, 10:22 AM
    • Brighton, England
    • Posts 2,205

    Hi,

    This is because a refresh is different to a postback. If you refresh the page IsPostBack will always be false, because as far as ASP.NET is concerned, the page is loading for the first time. If you want to implement this functionality, a better solution might be to use an AJAX Timer. You can add a timer to your page, and configure its interval to 30 seconds- it will then force an async postback on each timer tick and IsPostBack will equal true.

Page 1 of 1 (4 items)