0
I know the life cycle of ViewBag
of C# MVC
, is by request.
Doubt
If I set one ViewBag
with the same name in several controllers
, there is the possibility of the set information being read / misinterpreted in View
?
Example
- Request X access to
ControllerA
agoViewBag.Mensagem = "SOP"
- Y request access to
ControllerA
agoViewBag.Mensagem = "SO"
- Request W access to
ControllerB
agoViewBag.Mensagem = "SOPortuguês"
However, the Y request is rendered first, so it occurs when using the ViewBag.Mensagem
in View
, turn up SOPortuguês
instead of SO
?