Showing posts with label interval. Show all posts
Showing posts with label interval. Show all posts

Wednesday, March 28, 2012

Change TimerControl Interval property without postback

Hi,

I have a "Live monitor" scenario, where data in UpdatePanel is being updated on TimerControl tick.

I want to give user an ability to change interval. It works fine, but postback is needed to do so.

Any way to do it without a postback?

(I'm new to atlas, so please excuse me if it's obvious.)

hello.

well, if you're ready to build your own timer, then it's possible to do that in the client side. currently, the problem is that the timercontrol generates a client behavior but doesn't generateou an id. due to this, you cannot get a reference to the behavior in the client side and do need to do a postback to refresh that interval.

Change Between 2 Labels?

Okay lets say that i have 2 Labels and i Want AJAX to Change Between thoes when a given interval is reached, And what that do happen Automatic and Random Choice(Of thoes Labels Avai.)

I have the code behinde looking like this

Random RandomClass = new Random();
int n = RandomClass.Next(1, 2);
Label1.Text = "Tester";
Label1.Text = "damn";

But when i load the site.. Sure A Label is chose the last one and nothing else happen... Someone Please Direct me the correct direction :D

Are you trying to show and hide each labels on specific interval?

okay lets say i have 2 or 3 labels..

one text "Test"

and the other "Tester"

the last "Asp.net"

And i want the timer to Random choose one to show... the texts could be small quotes or some...


*BUMP*

Someone? :D


Hi.

You can use this code.

<asp:ScriptManager ID="sm1" runat="server" /> <asp:UpdatePanel ID="up1" runat="server" UpdateMode="always"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Tester" ></asp:Label> <asp:Label ID="Label2" runat="server" Text="damn" ></asp:Label> <asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick"> </asp:Timer> </ContentTemplate> </asp:UpdatePanel>

protected void Timer1_Tick(object sender, EventArgs e) { Random RandomClass =new Random();int n = RandomClass.Next(1, 3);if (n == 1) { Label1.Text ="Tester"; Label2.Text ="damn"; }else { Label1.Text ="damn"; Label2.Text ="Tester"; } }

Regards.


Thx mate ill try :D..

Is there a smart way than then

Else

cause if i have like 20 it will be pretty messy


*Bump*

Someone know a "smarter" way?