Why mvc Html.HiddenFor does not render my field?

后端 未结 4 896
甜味超标
甜味超标 2020-12-15 07:08

I\'m trying to do this simple thing

<%= Html.HiddenFor(model => model.Id)%>

the model is

[HiddenInput(DisplayValu         


        
4条回答
  •  不思量自难忘°
    2020-12-15 07:27

    I'm not sure if this is the case with you but the Html.HiddenFor() "do not output correct values after a post if the value is changed during the post." and this is a not a bug it was designed that way.

    Quick Fix :

    Don't use the helper, try this instead :

    
    

    Always worked for me :)

提交回复
热议问题