Exemple #1
0
        public IActionResult First()
        {
            TempData["Title"]  = "First";
            TempData["Title2"] = "First";
            ViewBag.Page       = "First";

            TempDataDto tempData = new TempDataDto();



            return(View("Ortak", tempData));
        }
Exemple #2
0
        public IActionResult Third()
        {
            string val  = TempData["Title"]?.ToString();
            string val2 = TempData["Title2"]?.ToString();

            ViewBag.Page = "Third";

            TempDataDto tempData = new TempDataDto()
            {
                Title  = val,
                Title2 = val2
            };

            return(View("Ortak", tempData));
        }
Exemple #3
0
        public IActionResult Second()
        {
            string val  = TempData.Peek("title")?.ToString();  //  ? tempdata boş değilse stringe çevir. peek sadece bu datayı tutar.
            string val2 = TempData["Title2"]?.ToString();

            ViewBag.Page = "Second";
            //TempData.Keep(); // buradaki tüm dataları tutar.

            TempDataDto tempData = new TempDataDto()
            {
                Title  = val,
                Title2 = val2
            };

            return(View("Ortak", tempData));
        }