Monday, March 26, 2012

Intermittent Logic

Hello all

Atlas TimerControl does not run "intermittent logic". This sample shows that only numbers not peers are shown, say 1,3,5, ... an so on.

Then the logic If i Mod 2 = 0 .. "do something" is not possible, or - how to do that?
--

<%@dotnet.itags.org. Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
' Sample by Harvey Triana

Protected Sub tickerTimer_Tick( _
ByVal sender As Object, ByVal e As System.EventArgs) Handles tickerTimer.Tick
Me.lblPrompt.Text = "RenderCount: " & RenderCount.ToString
RenderCount += 1
End Sub

' RenderCount was initialized in Global.asax, Session_Start, Session.Add("RenderCount", 0)
Private Property RenderCount() As Integer
Get
Return CType(Session("RenderCount"), Integer)
End Get
Set(ByVal value As Integer)
Session("RenderCount") = value
End Set
End Property

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<atlas:ScriptManager runat ="server" ID="sm" EnablePartialRendering ="true" />
<!-- Timer Update Panel -->
<atlas:TimerControl runat="server" Interval="1500" ID="tickerTimer" OnTick="tickerTimer_Tick" />
<atlas:UpdatePanel runat="server" ID="up" Mode="Conditional" >
<Triggers>
<atlas:ControlEventTrigger ControlID="tickerTimer" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="lblPrompt" runat="server"></asp:Label>
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html>


sorry, i say even, not "peers"

No comments:

Post a Comment