问题
Hi,
I have a ViewClass that contains a CI property (Guid), to keep track of this CI property I have added a hidden value for it like this :
<%: Html.HiddenFor(model => model.CI)%>
This does however render an empty hidden field, i have also tried :
<%: Html.Hidden("CI", Model.CI)%>
But with the same result.
When just typing :
<%: Model.CI %>
The Guid is printed for example like this : 5f7a1f53-9f90-4b77-aad4-64e835662efc
So why is this not working?
Edit1 :
This workes fine, but I do not see why HiddenFor is not working?
<input type="hidden" name="CI" value="<%: Model.CI %>" />
来源:https://stackoverflow.com/questions/4867717/asp-net-mvc-2-hiddenfield-is-empty