System.ComponentModel.DataAnnotations.compare vs System.Web.Mvc.Compare

前端 未结 6 1943
星月不相逢
星月不相逢 2020-12-24 04:44

MVC 4 Beta project fails to compile after upgrading to .Net 4.5.

This happens due to conflict between System.ComponentModel.DataAnnotations.CompareAttribute

6条回答
  •  甜味超标
    2020-12-24 05:39

    Using Visual Studio 2013 (MVC 5 project, .NET 4.5) the IntelliSense suggests that System.Web.Mvc.CompareAttribute is deprecated.

    I used System.ComponentModel.DataAnnotations.CompareAttribute and it works fine. It also does the client-side validation!

提交回复
热议问题