I need to call btn_submit_Click(object sender, EventArgs e)
from another method protected void Timer1_Tick(object sender, EventArgs e)
which normally calls by a button click.
Now here in Timer1_Tick
compares a time and if current time exceeds, i need to call btn_submit_Click(object sender, EventArgs e)
automatically.
protected void Timer1_Tick(object sender, EventArgs e)
{
DateTime et = DateTime.Parse(Session["endtime"].ToString());
if (DateTime.Now.TimeOfDay >= et.TimeOfDay)
{
// btn_submit_Click();
Response.Redirect("Welcome.aspx");
}
else
{
Label1.Text = DateTime.Now.ToLongTimeString();
}
}
Please suggest me a way to do this.