Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do I change the contents of fields on the page, let's say I want a picture or content change every minute.
That is, the field content is refreshed with new content on any interval

I tried to do that via ajax timer without success.


thanks & best regards
Eli
Posted

1 solution

Along with the timer you have to use UpdatePanel as well.

Check the link: http://msdn.microsoft.com/en-us/library/cc295400.aspx[^]
 
Share this answer
 
v2
Comments
eli gerby 13-May-13 4:17am    
see the following code, it's not work
the timer is changing , but no changes in "LABLE contents"


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="mapSite00.WebForm1" %>

<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolder2">
<asp:Panel ID="Panel1" runat="server" Height="132px">
<asp:Image ID="Image2" runat="server"
ImageUrl="~/DIS/arrows.png" Width="87px" />



<asp:Content ID="Content3" runat="server"
contentplaceholderid="ContentPlaceHolder3">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<contenttemplate>
<asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="1000">

<asp:Label ID="lblMsg1" runat="server" Text="Label">

<br />
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">

<br />


<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>







public void Timer1_Tick(object sender, EventArgs e)
{
int nRow = Convert.ToInt32(lblsave.Text);
lblMsg1.Text = xf1[nRow] + "<>" + DateTime.Now.ToLongTimeString();
nRow++;



}

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900