Hiddenfor not getting correct value from view model

前端 未结 4 1734
傲寒
傲寒 2020-12-02 16:55

I have a multi-step file import process. I have a hidden form input in my view that I am trying to populate with the \"CurrentStep\" from the view model.

<         


        
4条回答
  •  情歌与酒
    2020-12-02 17:18

    Make sure you model property has a "set" operator.

    This won't get updated on post-back:

    @Html.HiddenFor( m => m.NoSeq)

    public Class MyModel
    {
        int _NoSeq;
        public NoSeq
        {
            get { return _NoSeq };
        }
    }
    

提交回复
热议问题