We're trying to be type-safe in our views and use the new ExpressionInputExtenssion HtmlHelpers, but we are seeing some inconsistent results. We have a view that looks like this:
ViewData.Model.FooID = <%= ViewData.Model.FooID %><
Model.FooID = <%= Model.FooID %>
<%= Html.HiddenFor(x=>x.FooID) %>
But what we see in the rendered view is this:
ViewData.Model.FooID = 515b0403-e75b-4bd7-9b60-ef432f39d338
Model.FooID = 515b0403-e75b-4bd7-9b60-ef432f39d338
<input id="FooID" name="FooID" type="hidden" value="" />
I can manually add this:
<input id="FooID" name="FooID" type="hidden" value="<%= Model.FooID %>" />
But now we are no longer, but surprisingly when I do, The Html.HiddenFor always has the correct value.