Click here to Skip to main content
12,998,277 members (59,882 online)
Rate this:
Please Sign up or sign in to vote.
i'm having a scenario to call load event after every 5 seconds or 10 seconds some one help me.
Posted 19-Jul-12 21:29pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

you can use timer class and set tick property to 5000
deepgalley 20-Jul-12 12:11pm
No i wan't it in jquery or in ajax.
deepgalley 20-Jul-12 12:11pm
it should be asynchronous operation
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

There are various ways to refresh page automatically after certain interval of time.

Method #1:
Using META tag in head section: Meta Refresh Tag[^]
<meta http-equiv="Refresh" content="10;URL="></meta>

You can append meta tag from code behind too:
Response.AppendHeader("Refresh", "10; URL=")

Method #2:
Using Timer Control[^]: It allow you to do postbacks at certain intervals: Timer control[^]:
<asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
<asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
        <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
        <asp:Label runat="server" id="DateStampLabel" />

Method #3:
Using setTimeout in Javascript: Automatically refresh page after some interval[^]
function RefreshPage(Period)
    setTimeout("location.reload(true);", Period);
<body  önload="javaScript:RefreshPage(1000);">

Method #4:
Using Response.AppendHeader method: MSDN: HttpResponse.AppendHeader Method[^]
// Page refresh is set to 5 seconds after the client session timeout setting specified in the web.config file.
this.Response.AppendHeader("Refresh",Convert.ToString(Session.Timeout * 60 + 5));

Pick one that suits you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100