TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Roy r
NA
64
169.9k
Timer1_Tick not firing
Apr 19 2011 1:27 AM
I have two textboxs and one timer on my contet page.
In timer onTick event I am changing the text of Textbox2 to System.DateTime.Now.Second.
protected void Timer1_Tick(object sender, EventArgs e)
{
TextBox2.Text = System.DateTime.Now.Second.ToString();
Timer1.Enabled = false;
}
Initially timer is enabled so TextBox2 will fill initially.Then timer will Stop.
Now I want to enable timer,when user start typing in TextBox1. So I wrote following code..
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onkeypress", "myfunction()");
}
function myfunction() {
var timer = Sys.Application.findComponent("<%= Timer1.ClientID %>");
//returns the timer's interval in milliseconds:
var waitTime = timer.get_interval;
//sets the timer's interval to 5000 milliseconds (or 5 seconds):
timer.set_interval(3000);
//returns whether or not the timer is enabled:
var isTimerEnabled = timer.get_enabled();
//disables the timer:
timer.set_enabled(true);
//starts the timer:
timer._startTimer();
//stops the timer:
//timer._stopTimer();
}
Now I after 3 seconds page will do postback but Timer1_Tick will not call.
Any one knows why this is happening ?
Reply
Answers (
7
)
Problem in Asp.net built in Role Management System
selecting less text from database