MVC 易忘备留
1.ModelState.AddModelError("ServerMessage", MessageHelper.Instance.GetMessage(code));
@Html.ValidationMessage("ServerMessage")
2.private Field<DateTime?> _ExpiredDate = new Field<DateTime?>();
如果是底层返回的数据,则应该判断_ExpiredDate == null
如果你是new, 则判断_ExpiredDate.value == null
此类型前台绑定时,需要判断_ExpiredDate.Value==null,而不是_ExpiredDate==null
而private DateTime? _ExpiredDate;
则是判断 _ExpiredDate == null