How do I get a value of a property of a action
?
How do I get a value of a property of a action
?
In ASP.NET MVC you can use the ViewBag
object to transfer properties between the controller and the views.
In the controller, it looks like this:
ViewBag.Exemplo = "meu valor";
You can access this value in any view / template file being rendered at the moment as follows:
@ViewBag.Exemplo