I have an MVC4 site, with (as part of a hidden form):
<input name="somefield" type="hidden" value="@ViewBag.Test"/>
The value of ViewBag.Test
is true
. The form field is posting to an input parameter of the form:
public ActionResult SomeAction(bool somefield = false, ...)
but somefield
is always false
. Upon investigating, I see that the source code has:
<input name="somefield" type="hidden" value="value"/>
However, I know this used to work. What has happened, and what can I do?