MVC 5 Razor changes bool value in HiddenFor helper
<p>The problem is Razor (MVC 5) renders out HiddenFor and Hidden helper incorrectly.</p>

<p>I have a view model like this:</p>

<pre><code>public class MyViewModel
{
    public bool BoolValueInsideViewModel { get; set; }

    public MyViewModel()
    {
        BoolValueInsideViewModel = false;
    }
}
</code></pre>

<p>and controller is simple as:</p>

<pre><code>model = new MyViewModel();
        model.BoolValueInsideViewModel = false;
        return PartialView("_MyView", model);
</code></pre>

<p>Second line is just to be sure value is set to false.
View looks like this:</p>

<pre><code>@model MyViewModel
@Html.Hidden("BoolValueInsideViewModel", false)
@Html.Hidden("BoolValueNotInViewModel", false)
</code></pre>

<p>But on browser I get this:</p>

<pre><code>&lt;input data-val="true" data-val-required="The BoolValueInsideViewModel field is required." id="BoolValueInsideViewModel" name="BoolValueInsideViewModel" type="hidden" value="true"&gt;
&lt;input id="BoolValueNotInViewModel" name="BoolValueNotInViewModel" type="hidden" value="False"&gt;
</code></pre>

<p>Note that I have like 15 other view models and controller methods in same controller works fine with same code (I use HiddenFor with strongly typed values normaly, here I changed to Hidden to show that it does not work even with hard coded value in view).</p>

<p>Putting a break point on view, shows model is actually has BoolValueInsideViewModel equal to false, but result on browser is different. Also I get the result via JQuery post callback, so I checked raw string returning from AJAX function and the value there is also "True" instead of false.</p>

<p>What I tried:</p>

<ol>
<li>Clean up project and rebuild!</li>
<li>Renaming property</li>
<li>Renaming view model, even renaming file containing view model</li>
<li>Renaming view</li>
</ol>

<p>I know! It looks stupid and the most simplest thing on ASP.NET MVC, but I spent half a day on it. Other view models and partial views render correctly.</p>

<p>The weird thing is I don't have any data annotation on view model, but why it includes data validation attributes on the HTML element?</p>