ASP.NET MVC: Hidden field value does not get rendered using HtmlHelper.Hidden

前端 未结 2 1932
借酒劲吻你
借酒劲吻你 2020-12-07 14:18

Something pretty weird is happening with my app:

I have the following property in my ViewModel:

public int? StakeholderId { get; set; }
2条回答
  •  -上瘾入骨i
    2020-12-07 14:58

    The helper will first look for POSTed values and use them. As you are posting the form it will pick up the old value of the ID. Your workaround is correct.

提交回复
热议问题