随笔分类 - MVC
摘要:@model MyMusicStore.Models.Album@{ ViewBag.Title = "Details";}Details Album @Html.DisplayNameFor(mode...
阅读全文
posted @ 2018-07-25 23:04
dxm809
摘要:@model MyMusicStore.Models.Album@{ ViewBag.Title = "Edit";}Edit@using (Html.BeginForm()){ @Html.AntiForgeryToken() ...
阅读全文
posted @ 2018-07-25 23:03
dxm809
摘要:@model MyMusicStore.Models.Album@{ ViewBag.Title = "Delete";}DeleteAre you sure you want to delete this? Album ...
阅读全文
posted @ 2018-07-25 23:00
dxm809
摘要:@model MyMusicStore.Models.Album@{ ViewBag.Title = "Create";}Create@using (Html.BeginForm()) { @Html.AntiForgeryToken() ...
阅读全文
posted @ 2018-07-25 22:56
dxm809
摘要:@model IEnumerable@{ ViewBag.Title = "Index";}Index @Html.ActionLink("Create New", "Create") @Html.Displa...
阅读全文
posted @ 2018-07-25 22:54
dxm809
摘要:1 创建MVC应用程序2 在Model里面创建实体类using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace MyMusicStore.Mode...
阅读全文
posted @ 2018-07-25 22:32
dxm809
摘要:using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using S...
阅读全文
posted @ 2018-07-11 13:03
dxm809
摘要:1 通过Request接收数据,进行添加" %> Register 班级名称 创建时间 public ActionResult A...
阅读全文
posted @ 2018-06-19 09:41
dxm809
摘要:Asp.Net MVC+EF+三层架构的完整搭建过程架构图:使用的数据库:一张公司的员工信息表,测试数据解决方案项目设计:1.新建一个空白解决方案名称为Company2.在该解决方案下,新建解决方案文件夹(UI,BLL,DAL,Model) 当然还可以加上common...
阅读全文
posted @ 2018-06-02 08:40
dxm809
摘要:1 在Models里面创建类,用[Key]特性指定主键;2 在Model里面增加导航属性;3 在web.config里面增加连接字符串4 创建继承于DbContext的类5 创建Controller类,生成Index视图6 在Controller类的Index()里面...
阅读全文
posted @ 2018-04-26 17:21
dxm809
摘要:1 在Models下新建实体数据模型Model.edmx2 在Model.edmx中点右键建立各个实体,增加Scalar Property3 空白处点右键,添加关系,勾选增加外键4 保存Model.edmx, 空白处点右键,选择从模型生成数据库既可 ...
阅读全文
posted @ 2018-04-26 16:49
dxm809
摘要://UserInfoControllerusing ClassLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.N...
阅读全文
posted @ 2018-04-25 22:16
dxm809
摘要://Index.cshtml@model IQueryable@{ Layout = null;} Index @Html.ActionLink("添加", "Add", "ProductCrud") ...
阅读全文
posted @ 2018-04-25 22:05
dxm809
摘要:@model IQueryable@{ Layout = null;} Index CategoryName ProductName ...
阅读全文
posted @ 2018-04-25 15:43
dxm809
摘要:@*@model IQueryable*@@model IQueryable@{ Layout = null;} Index ModelNumber ...
阅读全文
posted @ 2018-04-25 14:09
dxm809
摘要:两种web服务•SOAP风格:基于方法,产品是WebService•REST风格:基于资源,产品是WebAPI对于数据的增、删、改、查,提供相对的资源操作,按照请求的类型进行相应处理,主要包括Get(查)、Post(增)、Put(改)、Delete(删),这些都是ht...
阅读全文
posted @ 2018-04-24 22:03
dxm809
摘要:using FilterExam.Fiter;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace...
阅读全文
posted @ 2018-04-24 20:57
dxm809
摘要:两种使用方式:1自定义类继承自相应的类或接口,重写方法,作为特性使用2 在控制器类中重写方法特性方式的使用注意:如果继承自接口需要让类实现FilterAttribute,才可以作为特性使用使用方式1:作为Controller或Action的特性使用方式2:在Globa...
阅读全文
posted @ 2018-04-24 19:48
dxm809
摘要:@model MVCFirst.Models.Person@{ Layout = null;} Add @using (Html.BeginForm("Add", "Person", FormMeth...
阅读全文
posted @ 2018-04-23 22:16
dxm809
浙公网安备 33010602011771号