Simple...
In X.aspx.cs file,
public partial class X: System.Web.UI.Page
{
public static int dt = 60;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["timerCount"] != null)
{
dt = Convert.ToInt32(Session["timerCount"]);
}
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = dt.ToString();
dt -= 1;
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["timerCount"] = dt;
Response.Redirect("Y.aspx");
}
}
In Y.aspx.cs,
public partial class WebForm2 : System.Web.UI.Page
{
public static int dt1;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
dt1 = Convert.ToInt32(Session["timerCount"]);
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = dt1.ToString();
dt1 -= 1;
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["timerCount"] = dt1;
Response.Redirect("X.aspx");
}
}
I set the timer interval to 1000. on both X & Y aspxs