04 2018 档案

摘要: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
摘要:@{ Layout = null;} Index //只能用此版本 + //第... 阅读全文
posted @ 2018-04-23 21:54 dxm809
摘要:1.添加引用RouteDebug.dll2 修改Global.asax,切记调试过后要删掉using System;using System.Collections.Generic;using System.Linq;using System.Web;using Sy... 阅读全文
posted @ 2018-04-23 15:12 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Web.Routing;namespa... 阅读全文
posted @ 2018-04-23 14:59 dxm809
摘要://HelloController.csusing FirstMVC.Models;using System;using System.Collections.Generic;using System.Linq;using System.Web;using Syste... 阅读全文
posted @ 2018-04-23 14:57 dxm809
摘要:•ViewResult:使用View()可以指定一个页面,也可以指定传递的模型对象,如果没有指定参数则表示返回与Action同名的页面•ContentResult:使用Content(string content)返回一个原始字符串•RedirectResult:使用... 阅读全文
posted @ 2018-04-23 09:19 dxm809
摘要:•在ViewModel中创建一个类型•在Action中为ViewData.Model赋值•在View中使用“@model类型”设置14 手动创建强类型视图•在ViewModel中创建一个类型•在Action中为ViewData.Model赋值•在View中使用“@mo... 阅读全文
posted @ 2018-04-22 21:06 dxm809
摘要:1专门用于MVC的链接方式:Html.Action(“Home”,“Index”),会根据路由规则生成a标记,并且在运行时可以进行有效性检查,不需要用户点击链接后才知道链接出错了2 Raw:输出3 Encode:进行Html编码4 Action:服务器端其它页面5 表... 阅读全文
posted @ 2018-04-22 20:44 dxm809
摘要:强大的@:表示使用C#代码,相当于aspx中的可以完成输出功能当遇到html标签时会认为C#代码结束,贪婪匹配后面的内容,如@a1会认为是变量a1,如@a1会认为是变量a会对标签内容进行Html编码注释:@*注释内容*@注意:@变量表示输出,结尾不加分号l引入命名空间... 阅读全文
posted @ 2018-04-22 20:42 dxm809
摘要:View和Controller都可以直接请求Model 但是Model不依赖View和controllerlController可以直接请求View来显示具体页面 View不依赖ControllerView可以通过另外的方式来请求Controller ... 阅读全文
posted @ 2018-04-22 19:20 dxm809
摘要:1项目就是一个应用程序。在VS中查看的时候,项目中建立的一般处理程序,有两个文件,网站只有一个。写个代码测试,发现在代码层次上没有2再有就是项目中的一般处理程序有命名空间,而网站中的没有。WEB网站每一个页面(ashx页面)都是一个独立的程序,一个页面出错了不会影响到... 阅读全文
posted @ 2018-04-21 11:36 dxm809
摘要://UserInfoList.html 用户列表页面 添加用户 ID 名字 密码 详情 删除 ... 阅读全文
posted @ 2018-04-19 23:18 dxm809
摘要:用户名: 密 码: 提交 using System;using System.Web;public class Accept : IHttpHandler { public void Proc... 阅读全文
posted @ 2018-04-19 09:05 dxm809
摘要:using System;using System.Web;public class SelfAdd : IHttpHandler { public void ProcessRequ... 阅读全文
posted @ 2018-04-19 09:04 dxm809
摘要:用户名: 密 码: 提交 using System;using System.Web;public class Accept : IHttpHandler { public void Proc... 阅读全文
posted @ 2018-04-18 23:30 dxm809
摘要://html 用户名 $UserName 密码 $UserPwd //.ashxusing ... 阅读全文
posted @ 2018-04-18 22:53 dxm809
摘要:状态代码有三位数字组成,第一个数字定义了响应的类别,且有五种可能取值:1xx:指示信息--表示请求已接收,继续处理2xx:成功--表示请求已被成功接收、理解、接受3xx:重定向--要完成请求必须进行更进一步的操作4xx:客户端错误--请求有语法错误或请求无法实现5xx... 阅读全文
posted @ 2018-04-18 16:58 dxm809
摘要://接收using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;u... 阅读全文
posted @ 2018-04-18 11:08 dxm809
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;usi... 阅读全文
posted @ 2018-04-18 10:28 dxm809
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;usi... 阅读全文
posted @ 2018-04-18 09:31 dxm809
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using... 阅读全文
posted @ 2018-04-18 08:56 dxm809
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using... 阅读全文
posted @ 2018-04-18 08:42 dxm809
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using... 阅读全文
posted @ 2018-04-18 08:36 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Security;using System.Security.Permissions;using System.S... 阅读全文
posted @ 2018-04-13 10:17 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Security.Principal;using System.Text;using System.Threadi... 阅读全文
posted @ 2018-04-13 10:07 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 15:26 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 15:14 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 15:01 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 14:48 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 14:30 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 14:19 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;... 阅读全文
posted @ 2018-04-11 14:11 dxm809
摘要:XXXModel:类库,设置默认空间为XXX.ModelXXXDAL:类库,设置默认空间为XXX.DALXXXBLL:类库,设置默认空间为XXX.BLLXXX:应用程序XXXDAL引用XXXModelXXXBLL引用XXXModel,XXXDALXXX引用XXXMod... 阅读全文
posted @ 2018-04-11 09:30 dxm809
摘要:Scale Percentage: 500 Print using System;... 阅读全文
posted @ 2018-04-10 13:56 dxm809
摘要:Hello there ... 阅读全文
posted @ 2018-04-10 13:27 dxm809
摘要:幼儿园同学 鼻涕虫 爱哭鬼 ... 阅读全文
posted @ 2018-04-08 21:47 dxm809
摘要:加粗 阅读全文
posted @ 2018-04-08 20:18 dxm809
摘要:腾讯微博 夏天来了,你懂得...... ... 阅读全文
posted @ 2018-04-08 19:52 dxm809
摘要:Thread (ParameterizedThreadStart) 初始化 Thread 类的新实例,指定允许对象在线程启动时传递给线程的委托。 Thread (ThreadStart) 初始化 Thread 类的新实例。 由 .NET Compact Fr... 阅读全文
posted @ 2018-04-08 17:10 dxm809
摘要: 欢迎你光临WPF的世界! 多线程同步调用 BeginInvoke 异步调用 using System;using System.Collections... 阅读全文
posted @ 2018-04-08 15:40 dxm809
摘要:using ClassLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Reflection;using System.Text;using Sys... 阅读全文
posted @ 2018-04-04 15:38 dxm809
摘要:using ClassLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;name... 阅读全文
posted @ 2018-04-04 11:10 dxm809
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace GenericExam{ ... 阅读全文
posted @ 2018-04-03 08:48 dxm809
摘要:腾讯微博 夏天来了,你懂得...... ... 阅读全文
posted @ 2018-04-03 08:47 dxm809
摘要:WPF DataGrid支持下面几种列类型:DataGridTextColumnDataGridCheckBoxColumnDataGridComboBoxColumnDataGridHyperLinkColumnDataGridTemplateColumn ... 阅读全文
posted @ 2018-04-02 13:55 dxm809
摘要:using ClassLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Text;using Sys... 阅读全文
posted @ 2018-04-02 13:49 dxm809