Model Binding not working

后端 未结 10 1424
别那么骄傲
别那么骄傲 2021-02-06 01:52

I have the following POCO classes:

public class Location
    {
        public int LocationId { get; set; }
        public string Name { get; set; }
        publi         


        
10条回答
  •  隐瞒了意图╮
    2021-02-06 02:13

    Also late to join the party, but after 3 years of asp.net mvc, I've came across that disabled inputs are not posted, so the model binder cannot bind them of course. See here:

    "Disabled elements in a form will not be submitted".

    Better use readonly="readonly" over disabled. See here.

提交回复
热议问题