开发者

ASP.NET MVC 2 HiddenField is empty?

开发者 https://www.devze.com 2023-02-07 19:29 出处:网络
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 :

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 %>" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号