Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Label value does not change with ajax timer

$
0
0

having an ajax timer running to check connection, 

wondering why the label lblsessiontimeleft inside update panel udpSession does not change accordingly, meant for it to decrease its value by one second thereafter

protected void TimerSession_Tick(object sender, EventArgs e)
  {
    recheckconn();

    if ((string)Session["sConnLetter"] == "c")
    {
      DateTime datetimenow = DateTime.Now;
      DateTime datetimesession;
      datetimesession = datetimenow.AddMilliseconds((int)Session["sSessionTimeout"]);

      TimeSpan tstd;
      TimeSpan tstd1;

      tstd = datetimesession.AddMilliseconds((int)Session["sSessionTimeout"]) - DateTime.Now;
      tstd1 = tstd.Subtract(new TimeSpan(0, 0, 1));

      if (Session["sSessionTimeout1"] != null)
      {
        Session["sTimeDifferent"] = datetimesession.AddMilliseconds((int)Session["sSessionTimeout1"]) - DateTime.Now;
        tstd = datetimesession.AddMilliseconds((int)Session["sSessionTimeout1"]) - DateTime.Now;
        tstd1 = tstd.Subtract(new TimeSpan(0, 0, 1));
      }

      Session["sSessionTimeout1"] = tstd1.Milliseconds;

      lblsessiontimeleft.Text = tstd1.Milliseconds.ToString();

      pnlSession.Style.Add("display", "block");
      udpSession.Update();

    }


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>