web 2.0

ASP.NET(vb.net) & Timer

ASP.NET(vb.net) & Timer - Performs asynchronous or synchronous Web page postbacks at a defined interval.

ShotDev Focus:
- ASP.NET(vb.net) & Timer

ASP.NET(vb.net) & Timer

Example

Timer.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Timer.aspx.vb" Inherits="Timer" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" Interval="1000" runat="server">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="http://www.scharffenberger.com/images/loading.gif" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>

Timer.aspx.vb


Partial Class Timer
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
UpdateProgress1.DisplayAfter = 100
UpdateProgress1.Visible = True
UpdateProgress1.DynamicLayout = True
End Sub

Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
System.Threading.Thread.Sleep(1000)
Label1.Text = "Welcome To ShotDev.Com : " & DateTime.Now.ToLongTimeString()
End Sub
End Class

Screenshot

ASP.NET(vb.net) & Timer
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

One Response to “ASP.NET(vb.net) & Timer”

  1. 2dismount…

Leave a Reply

You must be logged in to post a comment.