I'm kind of new at this and my English is also poor. Anyway:
I'm trying to set a Timer that refreshes my page if there is any new record on my report. Apparently my timer works fine because when i debugged it it enters into the function Timer1_Tick
, but it doesn't refresh my Page.
Here is the code:
System.Timers.Timer Timer1 = new System.Timers.Timer();
Timer1.Interval = 10000;
Timer1.Elapsed += Timer1_Tick;
Timer1.Enabled = true;
and
protected void Timer1_Tick(object sender, EventArgs e){
Response.Redirect("ReporteIncidencia.aspx"); //1st attempt
ScriptManager.RegisterStartupScript(Page, typeof(Page), "somekey", "RefreshPage()", true); //2nd attempt
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "RefreshPage()", true); //3rd attempt
}
also
<script type="text/javascript">
function RefreshPage()
{
window.location.reload()
}
</script>
EDIT:
- I'm using Framework .NET 3.5
- I tried with this post but it doesn't work.
- Thanks for answer.