コード例 #1
0
 public ActionResult Index(bool store = false, bool abandon = false)
 {
     if (store)
     {
         SessionStateHelper.Set(SessionStateKeys.NAME, "Adam");
     }
     if (abandon)
     {
         Session.Abandon();
     }
     return(RedirectToAction("Index"));
 }
コード例 #2
0
        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
        }
コード例 #3
0
 public ActionResult ProcessFirstForm(string name)
 {
     System.Diagnostics.Debug.WriteLine("Name: {0}", (object)name);
     SessionStateHelper.Set(SessionStateKeys.NAME, name);
     return(View("SecondForm"));
 }
コード例 #4
0
 public ActionResult ProcessFirstForm(string name)
 {
     SessionStateHelper.Set(SessionStateKeys.NAME, name);
     return(View("SecondForm"));
 }