摘要:
View命名 View下有多个模块的文件夹,我们根据微软的规定,每个模块下的首页都为Index.cshtml命名 获得当前页面的控制器名称 var currentControllerName = this.ViewContext.RouteData.Values["controller"].ToSt 阅读全文
摘要:
创建表单 Input 输入框 type: checkbox 多选 textarea 多文本输入框 select 下拉选择 在定义类Country的时候定义为: public IEnumerable<string> Country { get; set; }即可设置为可多选的选项; 默认不想选择数组中 阅读全文
摘要:
验证 attributes: 许多有用的验证属性都必须引用命名空间: System.ComponentModel.DataAnnotations IsValid [Compare]验证两个字段是否在model中匹配 [EmailAddress]验证该字段是否为邮箱格式 [Phone]验证该字段是否为 阅读全文
摘要:
需要使用vs2015 update3,同时也要安装.NET Core。 新建项目 添加Controller 右击controller文件夹,并添加一个新的controller.cs文件,修改其内容: 分别浏览网页http://localhost:52862/helloWorld和http://loc 阅读全文
摘要:
https://docs.asp.net/en/latest/mvc/models/validation.html 许多有用的验证属性都必须引用命名空间: System.ComponentModel.DataAnnotations IsValid [Compare]验证两个字段是否在model中匹配 阅读全文
摘要:
Flatify分页:<ul uib-pagination total-items="siteCount" items-per-page="1" max-size="10" boundary-links="true" rotate="false" previous-text="<" next-text 阅读全文