ASP.Net [HiddenInput] Data Attribute not working when rendered with Html.EditorForModel in Razor?

后端 未结 6 625
情歌与酒
情歌与酒 2021-01-11 18:01

I have the following model:

public class Product
{
    [HiddenInput(DisplayValue = false)]
    public int ProductID { get; set; }

    [Required(ErrorMessage         


        
6条回答
  •  灰色年华
    2021-01-11 18:26

    In my case the cause of this problem was that assembly containing model class and main web application project had references to different versions of System.Web.Mvc assembly.

    If you have couple projects referencing System.Web.Mvc assembly - ensure that used version is the same in all projects.

提交回复
热议问题