hiddenfor

Boolean with html helper Hidden and HiddenFor

What's up with this? The viewmodel variable is a bool with value true. <%= Html.HiddenFor(m => m.TheBool) %> <%= Html.Hidden("IsTimeExpanded",Model.TheBool) %> <input type="hidden" value="<%=Model.TheBool%>" name="TheBool" id="TheBool"> Results in: <input id="TheBool" name="TheBool" value="False" type="hidden"> <input id="TheBool" na...

How can i set Default value for HiddenFieldFor In Asp.Net MVC

i am using HiddenFor with model binding which is binding value to it. i want to reset the binded value to zero.How can i do it? i tried this but it is not working... <% foreach (var item in Model ) { %> <%: Html.HiddenFor(model => model.ID,new { @value="0"})%> <% } %> ...