How to get value from a property of an action?

-2

How do I get a value of a property of a action ?

    
asked by anonymous 19.11.2014 / 14:40

1 answer

0

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
    
19.11.2014 / 15:07