How to get value from an action property?

Asked

Viewed 69 times

-2

How do I get a value from a property action?

  • Property would be a field from a form in your View?

  • Yes I want to receive a value of a variable that I have in a view and add in another view.

1 answer

0

In ASP.NET MVC Voce you can use the object ViewBag to transfer properties between controller and views.

In the controller, it stays that way:

ViewBag.Exemplo = "meu valor";

You can access this value in any view/template file that is currently being rendered as follows:

@ViewBag.Exemplo
  • now as do to get a value of a variable in action?

  • @Hansmiller, your question is very poor in explanations... the more details you provide about your question/problem, the more correct the answers will be. You are free to edit the question and add information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.