禁止ASP.NET MVC模型绑定时将空字符串绑定为null
为model添加[DisplayFormat(ConvertEmptyStringToNull = false)]
[Display(ResourceType = typeof(AppStrings), Name = "MD_Company_ContactPhone")] [StringLength(100, ErrorMessageResourceType = typeof(AppStrings), ErrorMessageResourceName = "ValidationMessageMaxLength")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string ContactPhone { get; set; }