示例#1
0
        public ActionResult Edit()
        {
            //ViewBag.Name = SessionStateHelper.Get(SessionStateKeys.NAME);

            Article article = (Article)SessionStateHelper.Get(SessionStateKeys.NAME);

            return(View(article));
        }
示例#2
0
        public JsonResult OnGetIsActive()
        {
            var isActive = SessionStateHelper.IsUpdatedRecently(HttpContext.Session);

            return(new JsonResult(new
            {
                IsActive = isActive
            }));
        }
        public async Task InvokeAsync(HttpContext context)
        {
            if (!context.Request.Path.Value.Contains("Heartbeat"))
            {
                SessionStateHelper.UpdateSessionActivity(context.Session);
            }

            await _next(context);
        }
        public ActionResult CompleteForm(string country)
        {
            System.Diagnostics.Debug.WriteLine("Country: {0}", (object)country);
            // in a real application, this is where the call to create the
            // new user account would be

            ViewBag.Name    = SessionStateHelper.Get(SessionStateKeys.NAME).ToString();
            ViewBag.Country = country;
            return(View());
        }
 public ActionResult Index(bool store = false, bool abandon = false)
 {
     if (store)
     {
         SessionStateHelper.Set(SessionStateKeys.NAME, "Adam");
     }
     if (abandon)
     {
         Session.Abandon();
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult Index(Article article)
        {
            //return View();
            //return HttpNotFound();
            article.Title   = "Test Title";
            article.Created = DateTime.Now;
            //article.Content = "";
            article.Modified = DateTime.Now;

            Article articleWithId = _repository.Insert(article);

            _repository.Save();


            SessionStateHelper.Set(SessionStateKeys.NAME, articleWithId);
            return(RedirectToAction("Edit", "AdminArticle"));


            //return View();//redirect to edit and pass article in session
        }
 public ActionResult ProcessFirstForm(string name)
 {
     System.Diagnostics.Debug.WriteLine("Name: {0}", (object)name);
     SessionStateHelper.Set(SessionStateKeys.NAME, name);
     return(View("SecondForm"));
 }
示例#8
0
 public void OnGetUpdateActivity()
 {
     SessionStateHelper.UpdateSessionActivity(HttpContext.Session);
 }
 public ActionResult CompleteForm(string country)
 {
     ViewBag.Name    = SessionStateHelper.Get(SessionStateKeys.NAME);
     ViewBag.Country = country;
     return(View());
 }
 public ActionResult ProcessFirstForm(string name)
 {
     SessionStateHelper.Set(SessionStateKeys.NAME, name);
     return(View("SecondForm"));
 }