protected void Session_Start(object sender, EventArgs e) { var notifier = new NotificationComp(); var now = DateTime.Now; HttpContext.Current.Session["LastUpdated"] = now; notifier.Register(now); }
public JsonResult GetNotifications() { var registerdTime = Session["LastUpdated"] != null?Convert.ToDateTime(Session["LastUpdated"]) : DateTime.Now; var notifier = new NotificationComp(); var result = notifier.GetLikes(registerdTime); return(Json(result, JsonRequestBehavior.AllowGet)); }