摘要:
在System.ComponentModel.DataAnnotations命名空间中有一些特性类(如Required,Range),可以用来实现数据验证功能。使用时先在文件头部引入命名空间:using System.ComponentModel.DataAnnotations;namespace Test{public class User{ [Required] public int UserId{set; get;}[Range(1,200,ErrorMessage="年龄超出范围")] public int Age(set; get;}}}此外,在使用了实体框架EF 阅读全文
摘要:
一句话:将jQuery-1.4.4.min.js向你要编辑的文件拖动一份注意:在_layout.cs等文件中:将jQuery-1.4.4.min.js向文件头部拖动一份(可以把原来包含有服务器端代码的语句删除<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>) 阅读全文