O
O
Oleg2021-11-16 11:20:11
ASP.NET
Oleg, 2021-11-16 11:20:11

How to write ViewBag to pass data from Controller to View?

In the controller, I specified ViewBag.GomelNS1_Level_Tank400_1 = 7777777;
when outputting in view @ViewBag.GomelNS1_Level_Tank400_1 gives result 7777777
but when i output @[email protected]_TAG (where opc_TAG=GomelNS1_Level_Tank400_1 ) the result is System.Web.Mvc.DynamicViewDataDictionary.GomelNS1_Level_Tank400_1.
Why is that???????
If you output ITem .opc_TAG the result will be GomelNS1_Level_Tank400_1 everything is correct.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question