Dynamic TempData in ASP.NET MVC 3

I am trying to get a site running using ASP.NET MVC 3 and I came across a new dynamic ViewModel. It is very useful to quickly pass values ​​to a view without using magic lines. I am wondering if there is something similar for TempData that stores values ​​after RedirectToAction.

Thank.

+3
source share
2 answers

You can enable session state, as was used in web forms, and use this to store data, if you want, is that what interests you? Just google "session state in asp.net mvc"

When you do this ...

TempData ( "test" ) = " "

, tempdata.test( , tempdata ).

+2

TempData MVC 3 ( ), . :

TempData.Account = "Geronimo"

Account / .

ViewBag

ViewBag.Acount = "Geronimo" 

.

+4

Source: https://habr.com/ru/post/1776636/


All Articles