MVC Razor HTML Helper syntax: Viewbag in Html.Hidden object parameter

Solution 1:

Try casting the return value to object:

@Html.Hidden("hiddenDate", (object)ViewBag.myDate.ToString("dd.MM.yyyy"))