I have an Ajax timer, where I have the following code !!!strong text
protected void Timer1_Tick(object sender, EventArgs e)
{
TimeSpan time2 = new TimeSpan();
time2 = (DateTime)Session["Qtime"] - DateTime.Now;
if (time2.Seconds <= 10 && time2.Minutes == 0)
{
***if (time2.Seconds <= 0)
{
btn_submit.Enabled = false;
lbl_next.Text = "Please Go for next question!!";
}***
else
{
lbl_qstntime.Text = "[ " + time2.Seconds + " S ]";
lbl_qstntime.BackColor = Color.Red;开发者_如何学Go
//lbl_qstntimedesc.BackColor = Color.Red;
}
}
else
{
lbl_qstntime.Text = "[ " + time2.Seconds + " S ]";
}
}
The problem is when the seconds == 0 I am trying to disable one button, that is btn_submit.Enabled = false; lbl_next.Text = "Please Go for next question!!";
However that is not working Till I click any button (Including My submit button) in the page...
Can anyone tell me how can I achieve it, everything else is working just great :(
Requirement : "When variable seconds become 0 or l disable my Button ". Currently until I did not click any button it is not happening.
Thanks, Jithu
As @YuriyRozhovetskiy told I did not put the btn_submit inside the Update Panel. After putting the button inside update panel everything worked pretty well.
精彩评论