Using ASP.NET MVC and Razor, I'm trying to pass a ViewBag item from the controller to a HiddenFor field (using Razor). I get the following message: Extension methods cannot by dynamically dispatched.
@Html.HiddenFor(m=>m.PortfolioId, ViewBag.PortfolioId);
I'm not sure how to do it with the helper but you can achieve the same markup useing plain html: