Sign in
|
Join
|
Help
Search
Al Pascual
Home
Contact
About
RSS
Atom
Comments RSS
Geo RSS
Geo Twitter Timeline
Recent Posts
Rick Strahl’s view on the Oil is the best perspective I have seen,
Sample .NET map viewer source code released
Collecting Twitter stats using a Twitter Bot
Wii games for young kids 2008.
How to make a post request to Twitter in C# to add people to follow
Tags
.Net
.Telligent
Ajax
Apple
ASP.NET
ASP.NET 2.0
AT&T
Atlas
Award
Azure
Barack Obama
Bill Gates
Blogging
Books
C#
Channel 9
Chris Garrette
Code
Code Camp
Code Snip Collection
CodePlex
Community Server
Complains
crossdomain.xml
Dojo
Dynamic Data
Email
ESRI
Flex
Framework 3.0
FreeTextBox
Geo Twitter
GeoRSS
GIS
Google
Guy Kawasaki
Home Server
IEUG
IIS
IL
INETA
iPhone
iTunes
Jack & Stench
James Fee
JavaScript
jQuery
kiko
LINQ
LINQ to SQL
MAC
Mahalo
Mesh
Microsoft
MSDN
MVC
MVC Framework
MVP
MVP Summit
Open Source
Oracle
ORCS
PDC
Phil Haack
Podcast
Pownce
QIK
Random Thoughts
Rick Stahl
Rob Howard
Robert Scoble
RSS
Scott Guthrie
Scott Hanselman
SilverLight
Silverlight 2.0
SQL 2005
Team Foundation Server
Tech-Ed
Telerik
Telligent
TiVo
T-Shirts
Twitter
UC
UDP
Vacation
VB.NET
Vista
VS2005
VS2008
Web Stats
Wii
Windows 7
Woody Pewitt
WPF
XBOX
XNA
Yahoo
Zip
Navigation
Home
Blogs
Photos
Downloads
Blogs I read
Scott Guthrie
Robert Scoble
Scott Hanselman
Tom Archer
Brad Abrams
Woody Pewitt
My ASP.NET blog
Cloudy in Seattle
Rob Howard
Daniel Larson
James Fee
ASP.NET Community Blogs
Jon Galloway
Silverlight Roll
Shawn Wildermuth
Adam Kinney
Javier Lozano
Archives
January 2009 (1)
December 2008 (15)
November 2008 (6)
October 2008 (9)
September 2008 (9)
August 2008 (14)
July 2008 (6)
June 2008 (13)
May 2008 (15)
April 2008 (22)
March 2008 (16)
February 2008 (21)
January 2008 (23)
December 2007 (18)
November 2007 (19)
October 2007 (17)
September 2007 (15)
August 2007 (19)
July 2007 (16)
June 2007 (10)
May 2007 (13)
April 2007 (12)
March 2007 (18)
February 2007 (15)
January 2007 (5)
December 2006 (13)
November 2006 (27)
October 2006 (12)
September 2006 (22)
August 2006 (12)
July 2006 (16)
June 2006 (2)
May 2006 (5)
April 2006 (3)
March 2006 (1)
<
January 2009
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
Code Snip "AJAX Timer"
Tired of receiving the same email, this is the code for the timer. Normal mistake, people sets the timer outside the UpdatePanel
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server">
<
title
>
Untitled Page
</
title
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server">
<
asp
:
ScriptManager
ID
="ScriptManager1"
runat
="server"
/>
<
div
>
<
asp
:
UpdatePanel
ID
="UpdatePanel1"
runat
="server">
<
ContentTemplate
>
<
asp
:
Label
ID
="Label1"
runat
="server"
Text
="Label"></
asp
:
Label
>
<
asp
:
TextBox
ID
="TextBox1"
runat
="server"></
asp
:
TextBox
>
<
asp
:
Timer
ID
="Timer1"
runat
="server"
Interval
="5000"
OnTick
="Timer1_Tick">
</
asp
:
Timer
>
</
ContentTemplate
>
</
asp
:
UpdatePanel
>
</
div
>
</
form
>
</
body
>
</
html
>
protected
void
Page_Load(
object
sender,
EventArgs
e)
{
if
(!Page.IsPostBack)
Label1.Text =
"Timer will run every 5 seconds to display the time in an Update Panel"
;
}
protected
void
Timer1_Tick(
object
sender,
EventArgs
e)
{
Label1.Text =
DateTime
.Now.ToString();
}
Posted:
Dec 21 2006, 10:59 PM
by
albert
| with
3 comment(s)
Filed under:
ASP.NET 2.0
,
Ajax
,
Code Snip Collection
Comments
TrackBack
said:
#
December 22, 2006 2:42 PM
DotNetKicks.com
said:
You've been kicked (a good thing) - Trackback from DotNetKicks.com
#
December 22, 2006 9:52 PM
ujjwal b soni said:
Hi, The article is very nice !!! Regards, Ujjwal B Soni
#
September 15, 2008 2:57 AM