Auto Refresh Webpage

Last post 09-17-2008 6:29 AM by kannanmca. 10 replies.

Sort Posts:

  • Auto Refresh Webpage

    07-05-2007, 4:59 PM
    • Member
      24 point Member
    • storm721984
    • Member since 06-19-2007, 6:06 PM
    • Posts 51

    I need help here on how to auto refresh a webpage. As i'm using Visual Basic, and if possible to give me an actual full coding sample on where to put the codes. Furthermore is there any restriction of using the code if the page has MasterPage and sqldatasource in it?

  • Re: Auto Refresh Webpage

    07-05-2007, 5:13 PM
    Answer

    You do this with html - not VB, and you put the following in the <head> section of your page:

    <meta http-equiv="Refresh" content="300" />

    300 is the number of seconds. In this case, every 5 minutes. SqlDataSource makes no difference, but to use it with Master Pages, you should only add it to the page you want it to affect (using code-behind).  You can do this using the HtmlMeta class or by using Response.AppendHeader()

    http://west-wind.com/WebLog/posts/6841.aspx 

    For VB, use www.codechanger.com for a translation. 

    Regards Mike
    [MVP - ASP/ASP.NET]
    My site
    What ASP.NET can and can't do
  • Re: Auto Refresh Webpage

    07-05-2007, 5:19 PM
    Answer
    • All-Star
      37,391 point All-Star
    • Haissam
    • Member since 10-05-2006, 6:25 AM
    • Beirut - Lebanon
    • Posts 5,632

    Or you can use the below code at page_load event

    Page.ClientScript.RegisterStartupScript(Me.GetType(),"refresh","window.setTimeout('var url = window.location.href;window.location.href = url',1000);",true)

    Where 1000 is in milliseconds ( 1 second)

    HC

    Haissam Abdul Malak
    MCAD.NET
    | Blog |
  • Re: Auto Refresh Webpage

    07-05-2007, 5:25 PM
    • Member
      24 point Member
    • storm721984
    • Member since 06-19-2007, 6:06 PM
    • Posts 51

    Thanks a lot! Finally understand where to put it~

  • Re: Auto Refresh Webpage

    11-19-2007, 6:52 AM
    • Member
      54 point Member
    • Sheetal.Bhatt
    • Member since 10-23-2007, 1:00 PM
    • Ahmedabad,India
    • Posts 111

    hi guys,

    it works but it cause to load whole page and that makes the process slow.

    can anyone suggest me the way through which i can get updated data like we can get through ajax because i dont want to use ajax in my application.

    please reply me as soon as possible.

    its really urgent.

    thank you in advance.

  • Re: Auto Refresh Webpage

    11-19-2007, 7:09 AM
  • Re: Auto Refresh Webpage

    11-20-2007, 12:30 AM
    • Member
      54 point Member
    • Sheetal.Bhatt
    • Member since 10-23-2007, 1:00 PM
    • Ahmedabad,India
    • Posts 111

    hi,i have search on google,but i am not able to get it ,thats way i have asked this question.

    thank you Sad

     

  • Re: Auto Refresh Webpage

    11-20-2007, 2:42 AM

    Sheetal.Bhatt:

    hi,i have search on google,but i am not able to get it ,thats way i have asked this question.

     

    Read the rest of the article.  You will see that it advises you not to add your question to an existing thread, and gives reasons why it's not a good idea.  Make a new post in the correct forum. That way, a lot more people will see your question, and you are more likely to get an answer.  You see, this thread is resolved, and that means hardly anyone is looking at it.  Also, your question is about Ajax, and this particular forum is for basic Web Forms questions, so Ajax experts definitely won't be looking here.  I haven't really used Ajax, so I can't answer your question.

    To start a new thread,  click on http://forums.asp.net/1007.aspx and look for the button that says "Write a new post".

     

     

    Regards Mike
    [MVP - ASP/ASP.NET]
    My site
    What ASP.NET can and can't do
  • Re: Auto Refresh Webpage

    11-21-2007, 12:46 AM
    • Member
      54 point Member
    • Sheetal.Bhatt
    • Member since 10-23-2007, 1:00 PM
    • Ahmedabad,India
    • Posts 111

    hey,mike

    Thank You Very MuchBig Smile

  • Re: Auto Refresh Webpage

    05-03-2008, 2:44 AM
    • Member
      266 point Member
    • sanjev.sharma
    • Member since 03-01-2007, 9:40 AM
    • India
    • Posts 88

    very nice and precise artcle

    automatically refreshing update panel

    http://sanjevsharma.blogspot.com/2007/10/auto-refresh-update-panel-on-page-using.html

    Sanjeev Sharma
    Software Engineer
    Blog
  • Re: Auto Refresh Webpage

    09-17-2008, 6:29 AM
    • Member
      50 point Member
    • kannanmca
    • Member since 06-12-2008, 12:12 AM
    • India
    • Posts 25

     hi,

    im entry level program....

    wen im using tis code <meta http-equiv="refresh" content="5" />

    entire page il be loaded.. How can avoid entire page loaded?

    i need only some particular components only load....

    Thx in advance.....


     

Page 1 of 1 (11 items)